Skip to content

Debian 9 image for use with Ansible/Python automation tools like Molecule.

Notifications You must be signed in to change notification settings

vantaworks/docker-debian9-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Test Image - Debian 9 (Buster)

Build Status

This Docker container serves as a isolated testing environment for the development of Ansible roles and Playbooks and is part of a suite Docker images for that purpose. The primary use case is for Molecule testing. It is not intended for production applications.

Included Ansible developement tools

  • yamllint
  • ansible-lint
  • flake8
  • testinfra
  • molecule

Manual Build

Upstream images will be provided automatically; however, for manual builds, the only pre-requisite is Docker installed on your system and a local checkout of this repo.

  1. cd to you local checkout of this repo
  2. Run docker build -t docker-debian9-ansible or make dist

Manual Usage

These steps are only required if manual, one-off testing is used.

  1. Pull the image (skip if you manually built it): docker pull thisisvantaworks/debian9-ansible:latest
  2. Run the container:
docker run --detach --privileged \
  --name docker-debian9-ansible \
  --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro \
  --volume=`pwd`:/etc/ansible/roles/<role_under_test>:ro \
  thisisvantaworks/debian9-ansible:latest

Replace <role_under_test> with the name of your role.

  1. Execute ansible-playbook thusly:
docker exec -it docker-debian9-ansible \
  env TERM=xterm \
  ansible-playbook /path/to/ansible/playbook.yml \
  --syntax-check

Automated Build + Sanity Checks

Build the container, and perform the supplied sanity checks by using the all make target. This is the proceedure used by automated builds to verify the container's functionality.

make all

Recommendations

For Playbook Testing: I highly recommend looking into Molecule

Credits

Huge thanks to Jeff Geerling, which much of this repo's content is inspired by.

About

Debian 9 image for use with Ansible/Python automation tools like Molecule.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published