Ansible base images that can easily be used to run ansible against other hosts
1.6K
Ansible client container aimed to behave as much as possible as a locally installed Ansible.
Allows to run Ansible with a configuration on your local host using ssh keys and config from your localhost, updating any host in your network. This makes it very easy to get started with Ansible.
The easiest way to use this image is to install the wrapper scripts in a folder in your path. For example:
docker pull bertbaron/ansible
docker run --rm -ti -v /usr/local/bin:/workdir bertbaron/ansible setup
This will create wrapper scripts for the ansible commands in /usr/local/bin.1
The scripts run ansible as usual, mounting the current working directory to /workdir and the ~/.ssh
directory to /home/user/.ssh.
1 You can use any other folder (i.e. $HOME/bin), just make sure the folder is in your path
Instead of running the setup command again the version can also be easily updated using:
ansible-update
To uninstall, run:
ansible-uninstall
The scripts can be used as is, but note that you need to specify the hosts file explicitly because the command only sees the current working directory. Personally I use a simple wrapper script like the following:
#!/bin/bash
ansible-playbook -i hosts -b --vault-password-file=/home/user/.ssh/.pwd site.yml "$@"
Reasons to use Ansible from a container:
Reason to make yet another Ansible container:
Reasons not to use this image:
Content type
Image
Digest
sha256:8c8010a0e…
Size
137.3 MB
Last updated
almost 4 years ago
docker pull bertbaron/ansible