Skip to content

Latest commit

 

History

History
1212 lines (1026 loc) · 63.1 KB

README.md

File metadata and controls

1212 lines (1026 loc) · 63.1 KB

Docker image for ansible

Tag License

Build Status Build Status Build Status Build Status

Build Status Build Status Build Status

All #awesome-ci Docker images

ansible-lint ansible awesome-ci bandit black checkmake eslint file-lint gofmt goimports golint jsonlint linkcheck mypy php-cs-fixer phpcbf phpcs phplint pycodestyle pydocstyle pylint terraform-docs terragrunt-fmt terragrunt yamlfmt yamllint

All #awesome-ci Makefiles

Visit cytopia/makefiles for seamless project integration, minimum required best-practice code linting and CI.

View Dockerfile on GitHub.

Docker hub

Tiny Alpine-based multistage-build dockerized version of Ansible[1] in many different flavours. It comes with Mitogen[2] to speed up your runs by up to 600%[3][4] (see Examples). The image is built nightly against multiple stable versions and pushed to Dockerhub.

Available Docker image versions

This repository provides many different Ansible flavours (each flavour also divided into different Ansible versions). The following table shows a quick overview. For more details see further down below.

Flavour Based on Additional Python libs Additional binaries
base - cffi, cryptography, Jinja2, junit-xml, lxml, paramiko, PyYAML -
tools base dnspython, mitogen bash, git, gpg, jq, ssh, yq
infra tools docker, docker-compose, jsondiff, pexpect, psycopg2, pypsexec, pymongo, PyMySQL, smbprotocol rsync
azure tools azure-* -
aws tools awscli, botocore, boto, boto3 aws, aws-iam-authenticator
awsk8s aws openshift kubectl, oc
awskops awsk8s - kops
awshelm awsk8s - helm

Ansible base

The following Ansible Docker images are as small as possible and only contain Ansible itself.

Docker tag Build from
latest Latest stable Ansible version
2.11 Latest stable Ansible 2.11.x version
2.10 Latest stable Ansible 2.10.x version
2.9 Latest stable Ansible 2.9.x version
2.8 Latest stable Ansible 2.8.x version
2.7 Latest stable Ansible 2.7.x version
2.6 Latest stable Ansible 2.6.x version
2.5 Latest stable Ansible 2.5.x version
2.4 Latest stable Ansible 2.4.x version
2.3 Latest stable Ansible 2.3.x version

Ansible tools

The following Ansible Docker images contain everything from Ansible base and additionally: bash, git, gpg, jq, ssh and dnspython and Ansible mitogen strategy plugin (see Examples).

Docker tag Build from
latest-tools Latest stable Ansible version
2.11-tools Latest stable Ansible 2.11.x version
2.10-tools Latest stable Ansible 2.10.x version
2.9-tools Latest stable Ansible 2.9.x version
2.8-tools Latest stable Ansible 2.8.x version
2.7-tools Latest stable Ansible 2.7.x version
2.6-tools Latest stable Ansible 2.6.x version
2.5-tools Latest stable Ansible 2.5.x version
2.4-tools Latest stable Ansible 2.4.x version
2.3-tools Latest stable Ansible 2.3.x version

Ansible infra

The following Ansible Docker images contain everything from Ansible tools and additionally: docker, pexpect, psycopg2, pypsexec, pymongo, PyMySQL and smbprotocol Python libraries.

Docker tag Build from
latest-infra Latest stable Ansible version
2.11-infra Latest stable Ansible 2.11.x version
2.10-infra Latest stable Ansible 2.10.x version
2.9-infra Latest stable Ansible 2.9.x version
2.8-infra Latest stable Ansible 2.8.x version
2.7-infra Latest stable Ansible 2.7.x version
2.6-infra Latest stable Ansible 2.6.x version
2.5-infra Latest stable Ansible 2.5.x version
2.4-infra Latest stable Ansible 2.4.x version
2.3-infra Latest stable Ansible 2.3.x version

Ansible azure

The following Ansible Docker images contain everything from Ansible tools and additionally: azure.

Docker tag Build from
latest-azure Latest stable Ansible version
2.11-azure Latest stable Ansible 2.11.x version
2.10-azure Latest stable Ansible 2.10.x version
2.9-azure Latest stable Ansible 2.9.x version
2.8-azure Latest stable Ansible 2.8.x version
2.7-azure Latest stable Ansible 2.7.x version
2.6-azure Latest stable Ansible 2.6.x version
2.5-azure Latest stable Ansible 2.5.x version
2.4-azure Latest stable Ansible 2.4.x version
2.3-azure Latest stable Ansible 2.3.x version

Ansible aws

The following Ansible Docker images contain everything from Ansible tools and additionally: aws-cli, boto, boto3 and botocore.

Docker tag Build from
latest-aws Latest stable Ansible version
2.11-aws Latest stable Ansible 2.11.x version
2.10-aws Latest stable Ansible 2.10.x version
2.9-aws Latest stable Ansible 2.9.x version
2.8-aws Latest stable Ansible 2.8.x version
2.7-aws Latest stable Ansible 2.7.x version
2.6-aws Latest stable Ansible 2.6.x version
2.5-aws Latest stable Ansible 2.5.x version
2.4-aws Latest stable Ansible 2.4.x version
2.3-aws Latest stable Ansible 2.3.x version

Ansible awsk8s

The following Ansible Docker images contain everything from Ansible aws and additionally: openshift and kubectl.

Docker tag Build from
latest-awsk8s Latest stable Ansible version
2.11-awsk8s Latest stable Ansible 2.11.x version
2.10-awsk8s Latest stable Ansible 2.10.x version
2.9-awsk8s Latest stable Ansible 2.9.x version
2.8-awsk8s Latest stable Ansible 2.8.x version
2.7-awsk8s Latest stable Ansible 2.7.x version
2.6-awsk8s Latest stable Ansible 2.6.x version
2.5-awsk8s Latest stable Ansible 2.5.x version
2.4-awsk8s Latest stable Ansible 2.4.x version
2.3-awsk8s Latest stable Ansible 2.3.x version

Ansible awskops

The following Ansible Docker images contain everything from Ansible awsk8s and additionally: kops in its latest patch level version.

https://github.com/kubernetes/kops/releases

Kops 1.20 (latest 1.20.x)

Docker tag Build from
latest-awskops1.20 Latest stable Ansible version
2.11-awskops1.20 Latest stable Ansible 2.11.x version
2.10-awskops1.20 Latest stable Ansible 2.10.x version
2.9-awskops1.20 Latest stable Ansible 2.9.x version
2.8-awskops1.20 Latest stable Ansible 2.8.x version
2.7-awskops1.20 Latest stable Ansible 2.7.x version
2.6-awskops1.20 Latest stable Ansible 2.6.x version
2.5-awskops1.20 Latest stable Ansible 2.5.x version
2.4-awskops1.20 Latest stable Ansible 2.4.x version
2.3-awskops1.20 Latest stable Ansible 2.3.x version

Kops 1.19 (latest 1.19.x)

Docker tag Build from
latest-awskops1.19 Latest stable Ansible version
2.11-awskops1.19 Latest stable Ansible 2.11.x version
2.10-awskops1.19 Latest stable Ansible 2.10.x version
2.9-awskops1.19 Latest stable Ansible 2.9.x version
2.8-awskops1.19 Latest stable Ansible 2.8.x version
2.7-awskops1.19 Latest stable Ansible 2.7.x version
2.6-awskops1.19 Latest stable Ansible 2.6.x version
2.5-awskops1.19 Latest stable Ansible 2.5.x version
2.4-awskops1.19 Latest stable Ansible 2.4.x version
2.3-awskops1.19 Latest stable Ansible 2.3.x version

Kops 1.18 (latest 1.18.x)

Docker tag Build from
latest-awskops1.18 Latest stable Ansible version
2.11-awskops1.18 Latest stable Ansible 2.11.x version
2.10-awskops1.18 Latest stable Ansible 2.10.x version
2.9-awskops1.18 Latest stable Ansible 2.9.x version
2.8-awskops1.18 Latest stable Ansible 2.8.x version
2.7-awskops1.18 Latest stable Ansible 2.7.x version
2.6-awskops1.18 Latest stable Ansible 2.6.x version
2.5-awskops1.18 Latest stable Ansible 2.5.x version
2.4-awskops1.18 Latest stable Ansible 2.4.x version
2.3-awskops1.18 Latest stable Ansible 2.3.x version

Kops 1.17 (latest 1.17.x)

Docker tag Build from
latest-awskops1.17 Latest stable Ansible version
2.11-awskops1.17 Latest stable Ansible 2.11.x version
2.10-awskops1.17 Latest stable Ansible 2.10.x version
2.9-awskops1.17 Latest stable Ansible 2.9.x version
2.8-awskops1.17 Latest stable Ansible 2.8.x version
2.7-awskops1.17 Latest stable Ansible 2.7.x version
2.6-awskops1.17 Latest stable Ansible 2.6.x version
2.5-awskops1.17 Latest stable Ansible 2.5.x version
2.4-awskops1.17 Latest stable Ansible 2.4.x version
2.3-awskops1.17 Latest stable Ansible 2.3.x version

Kops 1.16 (latest 1.16.x)

Docker tag Build from
latest-awskops1.16 Latest stable Ansible version
2.11-awskops1.16 Latest stable Ansible 2.11.x version
2.10-awskops1.16 Latest stable Ansible 2.10.x version
2.9-awskops1.16 Latest stable Ansible 2.9.x version
2.8-awskops1.16 Latest stable Ansible 2.8.x version
2.7-awskops1.16 Latest stable Ansible 2.7.x version
2.6-awskops1.16 Latest stable Ansible 2.6.x version
2.5-awskops1.16 Latest stable Ansible 2.5.x version
2.4-awskops1.16 Latest stable Ansible 2.4.x version
2.3-awskops1.16 Latest stable Ansible 2.3.x version

Kops 1.15 (latest 1.15.x)

Docker tag Build from
latest-awskops1.15 Latest stable Ansible version
2.11-awskops1.15 Latest stable Ansible 2.11.x version
2.10-awskops1.15 Latest stable Ansible 2.10.x version
2.9-awskops1.15 Latest stable Ansible 2.9.x version
2.8-awskops1.15 Latest stable Ansible 2.8.x version
2.7-awskops1.15 Latest stable Ansible 2.7.x version
2.6-awskops1.15 Latest stable Ansible 2.6.x version
2.5-awskops1.15 Latest stable Ansible 2.5.x version
2.4-awskops1.15 Latest stable Ansible 2.4.x version
2.3-awskops1.15 Latest stable Ansible 2.3.x version

Kops 1.14 (latest 1.14.x)

Docker tag Build from
latest-awskops1.14 Latest stable Ansible version
2.11-awskops1.14 Latest stable Ansible 2.11.x version
2.10-awskops1.14 Latest stable Ansible 2.10.x version
2.9-awskops1.14 Latest stable Ansible 2.9.x version
2.8-awskops1.14 Latest stable Ansible 2.8.x version
2.7-awskops1.14 Latest stable Ansible 2.7.x version
2.6-awskops1.14 Latest stable Ansible 2.6.x version
2.5-awskops1.14 Latest stable Ansible 2.5.x version
2.4-awskops1.14 Latest stable Ansible 2.4.x version
2.3-awskops1.14 Latest stable Ansible 2.3.x version

Kops 1.13 (latest 1.13.x)

Docker tag Build from
latest-awskops1.13 Latest stable Ansible version
2.11-awskops1.13 Latest stable Ansible 2.11.x version
2.10-awskops1.13 Latest stable Ansible 2.10.x version
2.9-awskops1.13 Latest stable Ansible 2.9.x version
2.8-awskops1.13 Latest stable Ansible 2.8.x version
2.7-awskops1.13 Latest stable Ansible 2.7.x version
2.6-awskops1.13 Latest stable Ansible 2.6.x version
2.5-awskops1.13 Latest stable Ansible 2.5.x version
2.4-awskops1.13 Latest stable Ansible 2.4.x version
2.3-awskops1.13 Latest stable Ansible 2.3.x version

Kops 1.12 (latest 1.12.x)

Docker tag Build from
latest-awskops1.12 Latest stable Ansible version
2.11-awskops1.12 Latest stable Ansible 2.11.x version
2.10-awskops1.12 Latest stable Ansible 2.10.x version
2.9-awskops1.12 Latest stable Ansible 2.9.x version
2.8-awskops1.12 Latest stable Ansible 2.8.x version
2.7-awskops1.12 Latest stable Ansible 2.7.x version
2.6-awskops1.12 Latest stable Ansible 2.6.x version
2.5-awskops1.12 Latest stable Ansible 2.5.x version
2.4-awskops1.12 Latest stable Ansible 2.4.x version
2.3-awskops1.12 Latest stable Ansible 2.3.x version

Kops 1.11 (latest 1.11.x)

Docker tag Build from
latest-awskops1.11 Latest stable Ansible version
2.11-awskops1.11 Latest stable Ansible 2.11.x version
2.10-awskops1.11 Latest stable Ansible 2.10.x version
2.9-awskops1.11 Latest stable Ansible 2.9.x version
2.8-awskops1.11 Latest stable Ansible 2.8.x version
2.7-awskops1.11 Latest stable Ansible 2.7.x version
2.6-awskops1.11 Latest stable Ansible 2.6.x version
2.5-awskops1.11 Latest stable Ansible 2.5.x version
2.4-awskops1.11 Latest stable Ansible 2.4.x version
2.3-awskops1.11 Latest stable Ansible 2.3.x version

Kops 1.10 (latest 1.10.x)

Docker tag Build from
latest-awskops1.10 Latest stable Ansible version
2.11-awskops1.10 Latest stable Ansible 2.11.x version
2.10-awskops1.10 Latest stable Ansible 2.10.x version
2.9-awskops1.10 Latest stable Ansible 2.9.x version
2.8-awskops1.10 Latest stable Ansible 2.8.x version
2.7-awskops1.10 Latest stable Ansible 2.7.x version
2.6-awskops1.10 Latest stable Ansible 2.6.x version
2.5-awskops1.10 Latest stable Ansible 2.5.x version
2.4-awskops1.10 Latest stable Ansible 2.4.x version
2.3-awskops1.10 Latest stable Ansible 2.3.x version

Kops 1.9 (latest 1.9.x)

Docker tag Build from
latest-awskops1.9 Latest stable Ansible version
2.11-awskops1.9 Latest stable Ansible 2.11.x version
2.10-awskops1.9 Latest stable Ansible 2.10.x version
2.9-awskops1.9 Latest stable Ansible 2.9.x version
2.8-awskops1.9 Latest stable Ansible 2.8.x version
2.7-awskops1.9 Latest stable Ansible 2.7.x version
2.6-awskops1.9 Latest stable Ansible 2.6.x version
2.5-awskops1.9 Latest stable Ansible 2.5.x version
2.4-awskops1.9 Latest stable Ansible 2.4.x version
2.3-awskops1.9 Latest stable Ansible 2.3.x version

Kops 1.8 (latest 1.8.x)

Docker tag Build from
latest-awskops1.8 Latest stable Ansible version
2.11-awskops1.8 Latest stable Ansible 2.11.x version
2.10-awskops1.8 Latest stable Ansible 2.10.x version
2.9-awskops1.8 Latest stable Ansible 2.9.x version
2.8-awskops1.8 Latest stable Ansible 2.8.x version
2.7-awskops1.8 Latest stable Ansible 2.7.x version
2.6-awskops1.8 Latest stable Ansible 2.6.x version
2.5-awskops1.8 Latest stable Ansible 2.5.x version
2.4-awskops1.8 Latest stable Ansible 2.4.x version
2.3-awskops1.8 Latest stable Ansible 2.3.x version

Ansible awshelm

The following Ansible Docker images contain everything from Ansible awsk8s and additionally: helm in its latest patch level version.

https://github.com/helm/helm/releases

Helm 3.5 (latest 3.5.x)

Docker tag Build from
latest-awshelm3.5 Latest stable Ansible version
2.11-awshelm3.5 Latest stable Ansible 2.11.x version
2.10-awshelm3.5 Latest stable Ansible 2.10.x version
2.9-awshelm3.5 Latest stable Ansible 2.9.x version
2.8-awshelm3.5 Latest stable Ansible 2.8.x version
2.7-awshelm3.5 Latest stable Ansible 2.7.x version
2.6-awshelm3.5 Latest stable Ansible 2.6.x version
2.5-awshelm3.5 Latest stable Ansible 2.5.x version
2.4-awshelm3.5 Latest stable Ansible 2.4.x version
2.3-awshelm3.5 Latest stable Ansible 2.3.x version

Helm 3.4 (latest 3.4.x)

Docker tag Build from
latest-awshelm3.4 Latest stable Ansible version
2.11-awshelm3.4 Latest stable Ansible 2.11.x version
2.10-awshelm3.4 Latest stable Ansible 2.10.x version
2.9-awshelm3.4 Latest stable Ansible 2.9.x version
2.8-awshelm3.4 Latest stable Ansible 2.8.x version
2.7-awshelm3.4 Latest stable Ansible 2.7.x version
2.6-awshelm3.4 Latest stable Ansible 2.6.x version
2.5-awshelm3.4 Latest stable Ansible 2.5.x version
2.4-awshelm3.4 Latest stable Ansible 2.4.x version
2.3-awshelm3.4 Latest stable Ansible 2.3.x version

Helm 3.3 (latest 3.3.x)

Docker tag Build from
latest-awshelm3.3 Latest stable Ansible version
2.11-awshelm3.3 Latest stable Ansible 2.11.x version
2.10-awshelm3.3 Latest stable Ansible 2.10.x version
2.9-awshelm3.3 Latest stable Ansible 2.9.x version
2.8-awshelm3.3 Latest stable Ansible 2.8.x version
2.7-awshelm3.3 Latest stable Ansible 2.7.x version
2.6-awshelm3.3 Latest stable Ansible 2.6.x version
2.5-awshelm3.3 Latest stable Ansible 2.5.x version
2.4-awshelm3.3 Latest stable Ansible 2.4.x version
2.3-awshelm3.3 Latest stable Ansible 2.3.x version

Helm 3.2 (latest 3.2.x)

Docker tag Build from
latest-awshelm3.2 Latest stable Ansible version
2.11-awshelm3.2 Latest stable Ansible 2.11.x version
2.10-awshelm3.2 Latest stable Ansible 2.10.x version
2.9-awshelm3.2 Latest stable Ansible 2.9.x version
2.8-awshelm3.2 Latest stable Ansible 2.8.x version
2.7-awshelm3.2 Latest stable Ansible 2.7.x version
2.6-awshelm3.2 Latest stable Ansible 2.6.x version
2.5-awshelm3.2 Latest stable Ansible 2.5.x version
2.4-awshelm3.2 Latest stable Ansible 2.4.x version
2.3-awshelm3.2 Latest stable Ansible 2.3.x version

Helm 3.1 (latest 3.1.x)

Docker tag Build from
latest-awshelm3.1 Latest stable Ansible version
2.11-awshelm3.1 Latest stable Ansible 2.11.x version
2.10-awshelm3.1 Latest stable Ansible 2.10.x version
2.9-awshelm3.1 Latest stable Ansible 2.9.x version
2.8-awshelm3.1 Latest stable Ansible 2.8.x version
2.7-awshelm3.1 Latest stable Ansible 2.7.x version
2.6-awshelm3.1 Latest stable Ansible 2.6.x version
2.5-awshelm3.1 Latest stable Ansible 2.5.x version
2.4-awshelm3.1 Latest stable Ansible 2.4.x version
2.3-awshelm3.1 Latest stable Ansible 2.3.x version

Helm 3.0 (latest 3.0.x)

Docker tag Build from
latest-awshelm3.0 Latest stable Ansible version
2.11-awshelm3.0 Latest stable Ansible 2.11.x version
2.10-awshelm3.0 Latest stable Ansible 2.10.x version
2.9-awshelm3.0 Latest stable Ansible 2.9.x version
2.8-awshelm3.0 Latest stable Ansible 2.8.x version
2.7-awshelm3.0 Latest stable Ansible 2.7.x version
2.6-awshelm3.0 Latest stable Ansible 2.6.x version
2.5-awshelm3.0 Latest stable Ansible 2.5.x version
2.4-awshelm3.0 Latest stable Ansible 2.4.x version
2.3-awshelm3.0 Latest stable Ansible 2.3.x version

Helm 2.16 (latest 2.16.x)

Docker tag Build from
latest-awshelm2.16 Latest stable Ansible version
2.11-awshelm2.16 Latest stable Ansible 2.11.x version
2.10-awshelm2.16 Latest stable Ansible 2.10.x version
2.9-awshelm2.16 Latest stable Ansible 2.9.x version
2.8-awshelm2.16 Latest stable Ansible 2.8.x version
2.7-awshelm2.16 Latest stable Ansible 2.7.x version
2.6-awshelm2.16 Latest stable Ansible 2.6.x version
2.5-awshelm2.16 Latest stable Ansible 2.5.x version
2.4-awshelm2.16 Latest stable Ansible 2.4.x version
2.3-awshelm2.16 Latest stable Ansible 2.3.x version

Helm 2.15 (latest 2.15.x)

Docker tag Build from
latest-awshelm2.15 Latest stable Ansible version
2.11-awshelm2.15 Latest stable Ansible 2.11.x version
2.10-awshelm2.15 Latest stable Ansible 2.10.x version
2.9-awshelm2.15 Latest stable Ansible 2.9.x version
2.8-awshelm2.15 Latest stable Ansible 2.8.x version
2.7-awshelm2.15 Latest stable Ansible 2.7.x version
2.6-awshelm2.15 Latest stable Ansible 2.6.x version
2.5-awshelm2.15 Latest stable Ansible 2.5.x version
2.4-awshelm2.15 Latest stable Ansible 2.4.x version
2.3-awshelm2.15 Latest stable Ansible 2.3.x version

Helm 2.14 (latest 2.14.x)

Docker tag Build from
latest-awshelm2.14 Latest stable Ansible version
2.11-awshelm2.14 Latest stable Ansible 2.11.x version
2.10-awshelm2.14 Latest stable Ansible 2.10.x version
2.9-awshelm2.14 Latest stable Ansible 2.9.x version
2.8-awshelm2.14 Latest stable Ansible 2.8.x version
2.7-awshelm2.14 Latest stable Ansible 2.7.x version
2.6-awshelm2.14 Latest stable Ansible 2.6.x version
2.5-awshelm2.14 Latest stable Ansible 2.5.x version
2.4-awshelm2.14 Latest stable Ansible 2.4.x version
2.3-awshelm2.14 Latest stable Ansible 2.3.x version

Helm 2.13 (latest 2.13.x)

Docker tag Build from
latest-awshelm2.13 Latest stable Ansible version
2.11-awshelm2.13 Latest stable Ansible 2.11.x version
2.10-awshelm2.13 Latest stable Ansible 2.10.x version
2.9-awshelm2.13 Latest stable Ansible 2.9.x version
2.8-awshelm2.13 Latest stable Ansible 2.8.x version
2.7-awshelm2.13 Latest stable Ansible 2.7.x version
2.6-awshelm2.13 Latest stable Ansible 2.6.x version
2.5-awshelm2.13 Latest stable Ansible 2.5.x version
2.4-awshelm2.13 Latest stable Ansible 2.4.x version
2.3-awshelm2.13 Latest stable Ansible 2.3.x version

Helm 2.12 (latest 2.12.x)

Docker tag Build from
latest-awshelm2.12 Latest stable Ansible version
2.11-awshelm2.12 Latest stable Ansible 2.11.x version
2.10-awshelm2.12 Latest stable Ansible 2.10.x version
2.9-awshelm2.12 Latest stable Ansible 2.9.x version
2.8-awshelm2.12 Latest stable Ansible 2.8.x version
2.7-awshelm2.12 Latest stable Ansible 2.7.x version
2.6-awshelm2.12 Latest stable Ansible 2.6.x version
2.5-awshelm2.12 Latest stable Ansible 2.5.x version
2.4-awshelm2.12 Latest stable Ansible 2.4.x version
2.3-awshelm2.12 Latest stable Ansible 2.3.x version

Helm 2.11 (latest 2.11.x)

Docker tag Build from
latest-awshelm2.11 Latest stable Ansible version
2.11-awshelm2.11 Latest stable Ansible 2.11.x version
2.10-awshelm2.11 Latest stable Ansible 2.10.x version
2.9-awshelm2.11 Latest stable Ansible 2.9.x version
2.8-awshelm2.11 Latest stable Ansible 2.8.x version
2.7-awshelm2.11 Latest stable Ansible 2.7.x version
2.6-awshelm2.11 Latest stable Ansible 2.6.x version
2.5-awshelm2.11 Latest stable Ansible 2.5.x version
2.4-awshelm2.11 Latest stable Ansible 2.4.x version
2.3-awshelm2.11 Latest stable Ansible 2.3.x version

Docker environment variables

Environment variables are available for all flavours except for Ansible base.

Variable Default Allowed values Description
USER `` ansible Set this to ansible to have everything run inside the container by the user ansible instead of root
UID 1000 integer If your local uid is not 1000 set it to your uid to syncronize file/dir permissions during mounting
GID 1000 integer If your local gid is not 1000 set it to your gid to syncronize file/dir permissions during mounting
INIT_GPG_KEY `` string If your gpg key requires a password you can initialize it during startup and cache the password (requires INIT_GPG_PASS as well)
INIT_GPG_PASS `` string If your gpg key requires a password you can initialize it during startup and cache the password (requires INIT_GPG_KEY as well)
INIT_GPG_CMD `` string A custom command which will initialize the GPG key password. This allows for interactive mode to enter your password manually during startup. (Mutually exclusive to INIT_GPG_KEY and INIT_GPG_PASS)

Docker mounts

The working directory inside the Docker container is /data/ and should be mounted locally to the root of your project where your Ansible playbooks are.

Examples

Run Ansible playbook

docker run --rm -v $(pwd):/data cytopia/ansible ansible-playbook playbook.yml

Run Ansible playbook with Mitogen

Mitogen updates Ansible’s slow and wasteful shell-centric implementation with pure-Python equivalents, invoked via highly efficient remote procedure calls to persistent interpreters tunnelled over SSH.

No changes are required to target hosts. The extension is considered stable and real-world use is encouraged.

Configuration (option 1)

ansible.cfg

[defaults]
strategy_plugins = /usr/lib/python3.8/site-packages/ansible_mitogen/plugins/strategy
strategy         = mitogen_linear

Configuratoin (option 2)

# Instead of hardcoding it via ansible.cfg,  you could also add the
# option on-the-fly via environment variables.
export ANSIBLE_STRATEGY_PLUGINS=/usr/lib/python3.8/site-packages/ansible_mitogen/plugins/strategy
export ANSIBLE_STRATEGY=mitogen_linear

Invocation

docker run --rm -v $(pwd):/data cytopia/ansible:latest-tools ansible-playbook playbook.yml

Further readings:

Run Ansible playbook with non-root user

# Use 'ansible' user inside Docker container
docker run --rm \
  -e USER=ansible \
  -v $(pwd):/data \
  cytopia/ansible:latest-tools ansible-playbook playbook.yml
# Use 'ansible' user inside Docker container
# Use custom uid/gid for 'ansible' user inside Docker container
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -v $(pwd):/data \
  cytopia/ansible:latest-tools ansible-playbook playbook.yml

Run Ansible playbook with local ssh keys mounted

# Ensure to set same uid/gid as on your local system for Docker user
# to prevent permission issues during docker mounts
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -v ${HOME}/.ssh/:/home/ansible/.ssh/:ro \
  -v $(pwd):/data \
  cytopia/ansible:latest-tools ansible-playbook playbook.yml

Run Ansible playbook with local password-less gpg keys mounted

# Ensure to set same uid/gid as on your local system for Docker user
# to prevent permission issues during docker mounts
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -v ${HOME}/.gnupg/:/home/ansible/.gnupg/ \
  -v $(pwd):/data \
  cytopia/ansible:latest-tools ansible-playbook playbook.yml

Run Ansible playbook with local gpg keys mounted and automatically initialized

This is required in case your GPG key itself is encrypted with a password. Note that the password needs to be in single quotes.

# Ensure to set same uid/gid as on your local system for Docker user
# to prevent permission issues during docker mounts
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -e [email protected] \
  -e INIT_GPG_PASS='my gpg password' \
  -v ${HOME}/.gnupg/:/home/ansible/.gnupg/ \
  -v $(pwd):/data \
  cytopia/ansible:latest-tools ansible-playbook playbook.yml

Alternatively you can also export your GPG key and password to the shell's environment:

# Ensure to write the password in single quotes
export MY_GPG_KEY='[email protected]'
export MY_GPG_PASS='my gpg password'
# Ensure to set same uid/gid as on your local system for Docker user
# to prevent permission issues during docker mounts
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -e INIT_GPG_KEY=${MY_GPG_KEY} \
  -e INIT_GPG_PASS=${MY_GPG_PASS} \
  -v ${HOME}/.gnupg/:/home/ansible/.gnupg/ \
  -v $(pwd):/data \
  cytopia/ansible:latest-tools ansible-playbook playbook.yml

Run Ansible playbook with local gpg keys mounted and interactively interactively

The following will work with password-less and password-set GPG keys. In case it requires a password, it will ask for the password and you need to enter it.

# Ensure to set same uid/gid as on your local system for Docker user
# to prevent permission issues during docker mounts
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -e INIT_GPG_CMD='echo test | gpg --encrypt -r [email protected] | gpg --decrypt --pinentry-mode loopback' \
  -v ${HOME}/.gnupg/:/home/ansible/.gnupg/ \
  -v $(pwd):/data \
  cytopia/ansible:latest-tools ansible-playbook playbook.yml

Run Ansible Galaxy

# Ensure to set same uid/gid as on your local system for Docker user
# to prevent permission issues during docker mounts
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -v $(pwd):/data \
  cytopia/ansible:latest-tools ansible-galaxy install -r requirements.yml

Run Ansible playbook with AWS credentials

# Basic
docker run --rm \
  -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
  -v $(pwd):/data \
  cytopia/ansible:latest-aws ansible-playbook playbook.yml
# With AWS Session Token
docker run --rm \
  -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
  -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
  -v $(pwd):/data \
  cytopia/ansible:latest-aws ansible-playbook playbook.yml
# With ~/.aws/ config and credentials directories mounted (read/only)
# If you want to make explicit use of aws profiles, use this variant
# Ensure to set same uid/gid as on your local system for Docker user
# to prevent permission issues during docker mounts
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -v ${HOME}/.aws/config:/home/ansible/.aws/config:ro \
  -v ${HOME}/.aws/credentials:/home/ansible/.aws/credentials:ro \
  -v $(pwd):/data \
  cytopia/ansible:latest-aws ansible-playbook playbook.yml

Run Ansible playbook against AWS with gpg vault initialization

# Ensure to set same uid/gid as on your local system for Docker user
# to prevent permission issues during docker mounts
docker run --rm \
  -e USER=ansible \
  -e MY_UID=1000 \
  -e MY_GID=1000 \
  -e [email protected] \
  -e INIT_GPG_PASS='my gpg password' \
  -v ${HOME}/.aws/config:/home/ansible/.aws/config:ro \
  -v ${HOME}/.aws/credentials:/home/ansible/.aws/credentials:ro \
  -v ${HOME}/.gnupg/:/home/ansible/.gnupg/ \
  -v $(pwd):/data \
  cytopia/ansible:latest-aws \
  ansible-playbook playbook.yml

As the command is getting pretty long, you could wrap it into a Makefile.

ifneq (,)
.error This Makefile requires GNU Make.
endif

.PHONY: dry run

CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ANSIBLE = 2.8
UID = 1000
GID = 1000

# Ansible check mode uses mitogen_linear strategy for much faster roll-outs
dry:
ifndef GPG_PASS
	docker run --rm it \
		-e ANSIBLE_STRATEGY_PLUGINS=/usr/lib/python3.8/site-packages/ansible_mitogen/plugins/strategy \
		-e ANSIBLE_STRATEGY=mitogen_linear \
		-e USER=ansible \
		-e MY_UID=$(UID) \
		-e MY_GID=$(GID) \
		-v $${HOME}/.aws/config:/home/ansible/.aws/config:ro \
		-v $${HOME}/.aws/credentials:/home/ansible/.aws/credentials:ro \
		-v $${HOME}/.gnupg/:/home/ansible/.gnupg/ \
		-v $(CURRENT_DIR):/data \
		cytopia/ansible:$(ANSIBLE)-aws ansible-playbook playbook.yml --check
else
	docker run --rm it \
		-e ANSIBLE_STRATEGY_PLUGINS=/usr/lib/python3.8/site-packages/ansible_mitogen/plugins/strategy \
		-e ANSIBLE_STRATEGY=mitogen_linear \
		-e USER=ansible \
		-e MY_UID=$(UID) \
		-e MY_GID=$(GID) \
		-e INIT_GPG_KEY=$${GPG_KEY} \
		-e INIT_GPG_PASS=$${GPG_PASS} \
		-v $${HOME}/.aws/config:/home/ansible/.aws/config:ro \
		-v $${HOME}/.aws/credentials:/home/ansible/.aws/credentials:ro \
		-v $${HOME}/.gnupg/:/home/ansible/.gnupg/ \
		-v $(CURRENT_DIR):/data \
		cytopia/ansible:$(ANSIBLE)INIT_GPG_KEY` -aws \
		ansible-playbook playbook.yml --check
endif

# Ansible real run uses default strategy
run:
ifndef GPG_PASS
	docker run --rm it \
		-e USER=ansible \
		-e MY_UID=$(UID) \
		-e MY_GID=$(GID) \
		-v $${HOME}/.aws/config:/home/ansible/.aws/config:ro \
		-v $${HOME}/.aws/credentials:/home/ansible/.aws/credentials:ro \
		-v $${HOME}/.gnupg/:/home/ansible/.gnupg/ \
		-v $(CURRENT_DIR):/data \
		cytopia/ansible:$(ANSIBLE)-aws ansible-playbook playbook.yml
else
	docker run --rm it \
		-e USER=ansible \
		-e MY_UID=$(UID) \
		-e MY_GID=$(GID) \
		-e INIT_GPG_KEY=$${GPG_KEY} \
		-e INIT_GPG_PASS=$${GPG_PASS} \
		-v $${HOME}/.aws/config:/home/ansible/.aws/config:ro \
		-v $${HOME}/.aws/credentials:/home/ansible/.aws/credentials:ro \
		-v $${HOME}/.gnupg/:/home/ansible/.gnupg/ \
		-v $(CURRENT_DIR):/data \
		cytopia/ansible:$(ANSIBLE)-aws \
		ansible-playbook playbook.yml
endif

Important:

THE GPG_KEY and GPG_PASS will not be echo'ed out by the Make command and you are advised to export those values via your shell's export command to the env in order to hide it.

If you still want to specify them on the command line via make dry GPG_KEY='pass' and your pass or key contains one or more $ characters then they must all be escaped with an additional $ in front. This is not necessary if you export them.

Example: If your password is test$5, then you must use make dry GPG_PASS='test$$5'.

Then you can call it easily:

# With GPG password from the env
export GPG_KEY='[email protected]'
export GPG_PASS='THE_GPG_PASSWORD_HERE'
make dry
make run

# With GPG password on the cli
make dry GPG_KEY='[email protected]' GPG_PASS='THE_GPG_PASSWORD_HERE'
make run GPG_KEY='[email protected]' GPG_PASS='THE_GPG_PASSWORD_HERE'

# Without GPG password
make dry
make run

# With different Ansible version
make dry ANSIBLE=2.6
make run ANSIBLE=2.6

# With different uid/gid
make dry UID=1001 GID=1001
make run UID=1001 GID=1001

Build locally

To build locally you require GNU Make to be installed. Instructions as shown below.

Ansible base

# Build latest Ansible base
# image: cytopia/ansible:latest
make build

# Build Ansible 2.6 base
# image: cytopia/ansible:2.6
make build ANSIBLE=2.6

Ansible tools

# Build latest Ansible tools
# image: cytopia/ansible:latest-tools
make build ANSIBLE=latest FLAVOUR=tools

# Build Ansible 2.6 tools
# image: cytopia/ansible:2.6-tools
make build ANSIBLE=2.6 FLAVOUR=tools

Ansible infra

# Build latest Ansible infra
# image: cytopia/ansible:latest-infra
make build ANSIBLE=latest FLAVOUR=infra

# Build Ansible 2.6 infra
# image: cytopia/ansible:2.6-infra
make build ANSIBLE=2.6 FLAVOUR=infra

Ansible azure

# Build latest Ansible azure
# image: cytopia/ansible:latest-azure
make build ANSIBLE=latest FLAVOUR=azure

# Build Ansible 2.6 azure
# image: cytopia/ansible:2.6-azure
make build ANSIBLE=2.6 FLAVOUR=azure

Ansible aws

# Build latest Ansible aws
# image: cytopia/ansible:latest-aws
make build ANSIBLE=latest FLAVOUR=aws

# Build Ansible 2.6 aws
# image: cytopia/ansible:2.6-aws
make build ANSIBLE=2.6 FLAVOUR=aws

Ansible awsk8s

# Build latest Ansible awsk8s
# image: cytopia/ansible:latest-awsk8s
make build ANSIBLE=latest FLAVOUR=awsk8s

# Build Ansible 2.6 awsk8s
# image: cytopia/ansible:2.6-awsk8s
make build ANSIBLE=2.6 FLAVOUR=awsk8s

Ansible awskops

# Build latest Ansible with Kops 1.8
# image: cytopia/ansible:latest-awskops1.8
make build ANSIBLE=latest FLAVOUR=awskops KOPS=1.8

# Build Ansible 2.6 with Kops 1.8
# image: cytopia/ansible:2.6-awskops1.8
make build ANSIBLE=2.6 FLAVOUR=awskops KOPS=1.8

Ansible awshelm

# Build latest Ansible with Helm 2.14
# image: cytopia/ansible:latest-awshelm1.8
make build ANSIBLE=latest FLAVOUR=awshelm HELM=2.14

# Build Ansible 2.6 with Kops 1.8
# image: cytopia/ansible:2.6-awshelm1.8
make build ANSIBLE=2.6 FLAVOUR=awshelm HELM=2.14

Related #awesome-ci projects

Docker images

Save yourself from installing lot's of dependencies and pick a dockerized version of your favourite linter below for reproducible local or remote CI tests:

GitHub DockerHub Type Description
awesome-ci aci-hub-img Basic Tools for git, file and static source code analysis
file-lint flint-hub-img Basic Baisc source code analysis
linkcheck linkcheck-hub-img Basic Search for URLs in files and validate their HTTP status code
ansible ansible-hub-img Ansible Multiple versions and flavours of Ansible
ansible-lint alint-hub-img Ansible Lint Ansible
gofmt gfmt-hub-img Go Format Go source code [1]
goimports gimp-hub-img Go Format Go source code [1]
golint glint-hub-img Go Lint Go code
eslint elint-hub-img Javascript Lint Javascript code
jsonlint jlint-hub-img JSON Lint JSON files [1]
checkmake cm-hub-img Make Lint Makefiles
phpcbf pcbf-hub-img PHP PHP Code Beautifier and Fixer
phpcs pcs-hub-img PHP PHP Code Sniffer
phplint plint-hub-img PHP PHP Code Linter [1]
php-cs-fixer pcsf-hub-img PHP PHP Coding Standards Fixer
bandit bandit-hub-img Python A security linter from PyCQA
black black-hub-img Python The uncompromising Python code formatter
mypy mypy-hub-img Python Static source code analysis
pycodestyle pycs-hub-img Python Python style guide checker
pydocstyle pyds-hub-img Python Python docstyle checker
pylint pylint-hub-img Python Python source code, bug and quality checker
terraform-docs tfdocs-hub-img Terraform Terraform doc generator (TF 0.12 ready) [1]
terragrunt tg-hub-img Terraform Terragrunt and Terraform
terragrunt-fmt tgfmt-hub-img Terraform terraform fmt for Terragrunt files [1]
yamlfmt yfmt-hub-img Yaml Format Yaml files [1]
yamllint ylint-hub-img Yaml Lint Yaml files

[1] Uses a shell wrapper to add enhanced functionality not available by original project.

Makefiles

Visit cytopia/makefiles for dependency-less, seamless project integration and minimum required best-practice code linting for CI. The provided Makefiles will only require GNU Make and Docker itself removing the need to install anything else.

License

MIT License

Copyright (c) 2019 cytopia