Public | Automated Build

Last pushed: a year ago
Short Description
Docker container running CentOS 6 with systemd enabled for testing Ansible roles / playbooks
Full Description

CentOS 6 with Ansible

CentOS 6 container with Ansible installed for testing Ansible roles and playbooks

I NO LONGER USE THIS IMAGE FOR MY ANSIBLE TESTING, INSTEAD I HAVE STARTED TO USE MOLECULE AND STANDARD DOCKER IMAGES. AS SUCH, THIS IMAGE WILL NO LONGER BE MAINTAINED OR UPDATED

How to Build

  1. Install Docker
  2. Run docker build -t centos6-ansible-testing .

How to Use

This container is what I am using to test my Ansible roles and playbooks in an automated tool, such as Jenkins and Travis
but you can also use it to run the tests locally if you have Docker installed.

Using on Travis

Using locally

  1. Install Docker
  2. Pull the image docker pull visualcpu/centos6-ansible-testing:latest
  3. Run the container (you must run in a detached state)
     docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro --volume=`pwd`:/etc/ansible/roles/role_under_test:ro visualcpu/centos6-ansible-testing:latest /usr/lib/systemd/systemd`
    
  4. Run your role docker exec --tty <container_id> env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml

Notes

This container is what I use for testing Ansible roles and playbooks on CI tools such as Jenkins or Travis.

This container is not suitable for a production system

Docker Pull Command
Owner
visualcpu

Comments (0)