Sign inSign up

exsketrix/ansible

By exsketrix

•Updated about 5 years ago

Instructions on how to run these images can be found in: https://github.com/exsketrix/ansible

Image
0

2.3K

exsketrix/ansible repository overview

⁠Ansible Docker Image

⁠How to run this docker image:

    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

⁠Test and Development Lifecycle:

The following steps provide the basis for a continual test, develop and build lifecycle of this image:

  1. 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.

  2. 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
  1. Update 'roles/ansible-role/templates/Dockerfile.j2' with modifications required that will address the test verification changes. Execute the playbook to re-build the docker image.
    ansible-playbook -i inventory create-docker-image.yml
  1. Re-run molecule test to verify all tests including modified/additional test verifications now pass.
    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.

Tag summary

Content type

Image

Digest

Size

219.2 MB

Last updated

about 5 years ago

docker pull exsketrix/ansible