Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 2.41 KB

README.md

File metadata and controls

51 lines (40 loc) · 2.41 KB

Archlinux Ansible Test Image

semantic release weekly build

Archlinux Docker container for Ansible playbook and role testing. Adapted from Jeff Geerlings fabulous container images for ansible testing.

How to Build

The image is built once a week in this GitHub actions workflow to keep the repository on Docker Hub up to date with arch linux's rolling release. But if you need to build the image on your own locally, do the following:

  1. Install Docker.
  2. cd into this directory.
  3. Run docker build -t archlinux-ansible .

How to Use

  1. Install Docker.
  2. Pull this image from Docker Hub: docker pull gliech/docker-archlinux-ansible:latest (or use the image you built earlier, e.g. archlinux-ansible:latest).
  3. Run a container from the image: docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro gliech/docker-archlinux-ansible:latest (to test Ansible roles, you can add in a volume mounted from the current working directory with --volume=`pwd`:/etc/ansible/roles/role_under_test:ro).
  4. Use Ansible inside the container:
    1. docker exec --tty [container_id] env TERM=xterm ansible --version
    2. docker exec --tty [container_id] env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml --syntax-check

Important Note: The image is meant to be used for testing in an isolated environment not for production. The settings and configuration used may not be suitable for a secure and performant production environment. Use on production servers/in the wild at your own risk!

Authors

Original images and documentation by Jeff Geerling, author of Ansible for DevOps. Adapted for Archlinux by Gregor Bückendorf.