Ansible testing inside Docker.
100K+
This image is to test the functionality of Ansible from within a container. It is aimed at being used only with CI tests of Ansible roles or playbooks.
Dockerfile linkslatest, 2.10-ubuntu-20.04 Dockerfile2.10-ubuntu-18.04 Dockerfile2.10-centos-7 Dockerfile2.10-centos-8 Dockerfile2.10-stretch Dockerfile2.10-buster Dockerfile2.9-ubuntu-20.04 Dockerfile2.9-ubuntu-18.04 Dockerfile2.9-centos-7 Dockerfile2.9-centos-8 Dockerfile2.9-stretch Dockerfile2.9-buster DockerfileTo leverage Mitogen to accelerate your playbook runs, add this to your ansible.cfg:
Please investigate in your container the location of ansible_mitogen (it is different per container). You can do this via:
your_container="ansible:latest"
docker run --rm -it "willhallonline/${your_container}" /bin/sh -c "find / -type d | grep "ansible_mitogen/plugins" | sort | head -n 1"
and then configuring your own ansible.cfg like:
[defaults]
strategy_plugins = /usr/local/lib/python3.7/site-packages/ansible_mitogen/plugins/
strategy = mitogen_linear
You will likely need to mount required directories into your container to make it run (or build on top of what is here).
$ docker run --rm -it willhallonline/ansible-test:latest /bin/sh
$ docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible-test:latest /bin/sh
$ docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible-test:latest ansible-playbook playbook.yml
Content type
Image
Digest
sha256:1d3e1fcb3…
Size
351.6 MB
Last updated
6 days ago
docker pull willhallonline/ansible-test