Instructions on how to run these images can be found in: https://github.com/exsketrix/ansible
2.3K
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/ansible-playbook exsketrix/ansible:<ansible_version> <ansible_cmd> <ansible_playbook_args>
Example execution:
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/ansible-playbook exsketrix/ansible:2.9.9 ansible-playbook -i /ansible-playbook/inventory /ansible-playbook/run_playbook.yml
The following steps provide the basis for a continual test, develop and build lifecycle of this image:
Before making modifications to the Dockerfile in 'roles/ansible-role/templates/Dockerfile.j2', consider whether any changes that need to be made can be verified using testinfra. If this is the case, first go into 'roles/ansible-role/molecule/default/tests/test_default.py' and update and/or add further tests.
Execute molecule to confirm test failures.
cd roles/ansible-role
docker run --rm -it \
-v "$(pwd)":/tmp/$(basename "${PWD}"):rw \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /tmp/$(basename "${PWD}") \
quay.io/ansible/molecule:3.0.3 \
molecule test
ansible-playbook -i inventory create-docker-image.yml
cd roles/ansible-role
docker run --rm -it \
-v "$(pwd)":/tmp/$(basename "${PWD}"):rw \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /tmp/$(basename "${PWD}") \
quay.io/ansible/molecule:3.0.3 \
molecule test
Refer to the official TestInfra Modules API for the complete set of functions that can be tested.
Content type
Image
Digest
Size
219.2 MB
Last updated
about 5 years ago
docker pull exsketrix/ansible