Skip to content

chriswayg/docker-alpine-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arch Linux (latest) Ansible Test Image

Build Status Docker Automated build

Alpine Linux (latest) Docker container for Ansible playbook and role testing.

How to Build

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:

  1. Install Docker.
  2. Clone this repository.
  3. cd into the repository directory.
  4. Run docker build -t local-alpine-ansible .

How to Use

  1. Install Docker.

  2. Pull this image from Docker Hub: docker pull chriswayg/docker-alpine-ansible (or use the tag you built earlier, e.g. local-alpine-ansible).

  3. 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 alpine_ansible_1 \
     --volume=$(pwd):/etc/ansible/roles/role_under_test:rw \
     chriswayg/docker-alpine-ansible
    
  4. Use Ansible inside the container: - docker exec --tty alpine_ansible_1 ansible --version - docker exec --tty alpine_ansible_1 ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check - docker exec --tty alpine_ansible_1 ansible-playbook -vv /etc/ansible/roles/role_under_test/tests/test.yml

Notes

I 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!

Authors

About

🐳 Alpine Linux Docker container for Ansible playbook and role testing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published