Skip to content

onksingh/debian8-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

Debian 8 Ansible Test Image

Docker Automated build

This is a container for testing Ansible roles. It includes the latest version of Ansible and is rebuilt regularly.

Build

To build your own version of this container, run:

docker build -t debian8-ansible .

Testing a role inside the container

To run a role inside the container, you need to run the container with your role mounted inside it. I mount my current role directory as /etc/ansible/roles/role_under_test inside the container, but you can call it whatever you like.

docker run --privileged -d --volume="$(pwd)":/etc/ansible/roles/role_under_test:ro --name ansible-test debian8-ansible /sbin/systemd

Once your container is running with your role mounted inside it, you can run you test playbook included inside the role. This is a simple playbook that just runs role_under_test against localhost.

docker exec -t ansible-test ansible-playbook ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml

You can attach to the running container by using docker exec

docker exec -i -t ansible-test bash

Once you are done testing, you can stop and remove the container.

docker stop ansible-test
docker rm ansible-test

some update

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •