Observed since 20 Oct, 19:51 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Ansible Docker Role Testing
adroit - Ansible Docker Role TestingHeavily opinionated tool for testing Ansible roles using Docker containers.
These are the current assumptions about your Ansible codebase which might prevent you from using Adroit. They are subject to change or improve.
base role which other roles can build upon. (If you don't need this, you can just have an empty roles/base directory).include_role and dependencies defined in meta should still work, though.Feel free to open a Github issue about any limitations that prevent you from using Adroit.
base role will be applied to the container, and it is saved as the base image.Adroit will check if the role playbook fails, and will also run the playbook a second time to test for idempotency - if there are any changes on the second run, we consider it a failure.
To properly test Ansible using Docker containers, systemd needs to be running inside the containers. This requires the containers to run in privileged mode. There is a security risk involved here, check your base images and playbooks accordingly.
In a virtualenv or whatever you prefer: pip install adroit
In the root directory of your Ansible tree structure, which should at least contain a roles directory, run this command:
adroit -d debian:stretch myrole
Where debian:stretch is the image you want to base your tests on. Currently supported are Debian, Ubuntu and CentOS.
Certain tasks simply cannot be ran inside a Docker container - for example, mounting /proc with hidepid=2. You should add a when clause to these tasks. Example:
- when: ansible_virtualization_type != 'docker'
import_tasks: configure_network.yml
If you need certain variables to be set which aren't in defaults or vars but should be set during testing, you can create a file like roles/myrole/testing/test_vars.yml and it will be applied when testing that particular role.
The contents of this repository is released under the MIT license. See the LICENSE file included for details.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3 | 12 Sept 2018 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:51 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7382a6c81541ac3625e4b1234247dbc0ee92c1e725a77784823d8c552d369d2f