This Docker image is based on Alpine and Python3 and provides the Ansible executable. Check the repo tags for the available Ansible versions.
$ docker run --rm stingus/ansible -v <your_ansible_project_path>:/project
This will start a Docker container with your Ansible project mounted in /project
.
You can also mount your .ssh host directory in the container to inherit all the keys and config files:
$ docker run --rm stingus/ansible -v <your_ansible_project_path>:/project -v ~/.ssh:/root/ssh
It's recommended to keep your inventory in the project and not to rely on /etc/ansible/hosts from the running container.
$ ansible-playbook -i hosts your_playbook.yml
MIT