I have a repository with the structure same as that of the Directory Hierarchy as that mentioned by the Ansible Runner documentation.
The project is all playbooks and no roles. I have a tests
directory where each subdirectory within it is a testcase which performs the following:
- run the playbook to be tested
- perform assertion tests
There is no Molecule or ansible-test
here because the playbooks rely on mostly either builtin
or some community.docker
or community.general
collections.
Each test case also has the same Directory Hierarchy Ansible Runner structure since it reflects an isolated test for the playbook under test.
The only thing I am currently hacking is copying the core inventory
directory into each test case and then running the tests via a bash script which essentially is ansible-runner run
.
I am looking for references or examples of how some Ansible Runner projects can be programmitcally tested either by using python test frameworks or something that is considered best practice in the ansible world