Skip to content

hicknhack-software/ansible-docker-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker image to run Ansible

This Docker image aims to ensure that everybody is using the same Ansible environment for deploying to production.

The image is based on a selected Ubuntu distro and contains minimal Ansible (Core) installation.

Maintaining multiple versions of Ansible can be a hassle. Therefore we started to use a common docker image for all Devops activity. This makes it easy to check new versions and upgrade the Ansible roles and playbooks.

Usage

The default entry point is bash.

Old Python2 based Ansible versions:

docker run -it --rm --mount src="$(pwd)",target=/ansible,type=bind hnhs/ansible:py2-bionic-2.5.4 ansible-playbook ...

Latest Python3 based Ansible versions:

docker run -it --rm --mount src="$(pwd)",target=/ansible,type=bind hnhs/ansible:focal-2.17.4

We recommend to mount a volume for the ansible galaxy roles and collections.

Build and Hack

All build arguments are introduced at the top of the Dockerfiles.

docker build --build-arg ANSIBLE_VERSION=2.5.4 --build-arg ANSIBLE_GIT_BRANCH=v2.5.4 -t ansible:py2-2.5.4 python2
docker build --build-arg ANSIBLE_VERSION=2.5.4 --build-arg ANSIBLE_GIT_BRANCH=v2.5.4 -t ansible:2.5.4 python3
docker build --build-arg ANSIBLE_VERSION=2.11.4 --build-arg ANSIBLE_GIT_BRANCH=v2.11.4 -t ansible:2.11.4 python3
docker build --build-arg DISTRO=noble --build-arg ANSIBLE_VERSION=2.17.4 --build-arg ANSIBLE_GIT_BRANCH=v2.17.4 -t ansible:2.17.4 python3

About

Ansible tools inside a Docker container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages