0

The ansible-galaxy tool can create a skeleton of an Ansible role. (ansible-galaxy role init myrolename) Inside is a tests directory, but the Ansible documentation does not mention what it's for. Presumably tests of some sort, but who runs them, and how?

De117
  • 351
  • 2
  • 11

1 Answers1

0

Travis CI.

The tests directory seems to have been added in 2015, in PR #13489, and its description makes it clear that it's for Travis. It also adds .travis.yml, which looks like it does nothing by default. Snippet:

script:
  # Basic role syntax check
  - ansible-playbook tests/test.yml -i tests/inventory --syntax-check

I am not aware of any other tools using it.

De117
  • 351
  • 2
  • 11
  • The inventory is not needed because you can do the same thing as: ansible-playbook tests/test.yml -i localhost, --syntax-check – bbaassssiiee Aug 18 '22 at 16:12
  • @bbaassssiiee I understand that. I just copied the snippet verbatim from the autogenerated `.travis.yml` file to show that it doesn't really do anything by default. – De117 Aug 19 '22 at 16:26