Arch Linux container for Ansible playbook & role testing (autobuilds after base/archlinux updates)
835
Arch Linux (latest) Docker container for Ansible playbook and role testing.
This image is built on Docker Hub automatically any time a commit is made or merged to the master branch. But if you need to build the image on your own locally, do the following:
cd into the repository directory.docker build -t local-archlinux-ansible .Pull this image from Docker Hub:
docker pull chriswayg/docker-archlinux-ansible:latest (or use the tag you built earlier, e.g. local-archlinux-ansible).Run a container from the image: (to test my Ansible roles, I add in a volume mounted from the current working directory).
docker run --detach --privileged --name archlinux_ansible_1 --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro --volume=$(pwd):/etc/ansible/roles/role_under_test:rw chriswayg/docker-archlinux-ansible:latestUse Ansible inside the container:
docker exec --tty archlinux_ansible_1 env TERM=xterm ansible --versiondocker exec --tty archlinux_ansible_1 env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-checkdocker exec --tty archlinux_ansible_1 env TERM=xterm ansible-playbook -vv /etc/ansible/roles/role_under_test/tests/test.ymlI use Docker to test my Ansible roles and playbooks on multiple OSes using CI tools like Travis. This container allows me to test roles and playbooks using Ansible running locally inside the container.
Important Note: I use this image for testing in an isolated environment — not for production — and the settings and configuration used may not be suitable for a secure and performant production environment. Use on production servers at your own risk!
docker-{distro}-ansibleContent type
Image
Digest
Size
275.2 MB
Last updated
almost 6 years ago
docker pull chriswayg/docker-archlinux-ansible