Welcome to dockerfile-ansible

With this docker image you can create a temporary container to run ansible(-playbook), after ansible is finished the container will be removed automatically.

This image is tested with boot2docker on OSX and virtualbox with Centos

Version of ansible at this moment is 1.9.2

More information about how to install boot2docker or docker on centos

This github repository is integrated with docker hub, the build is automated and the image is available inside the docker public registry.

docker search dockerfile-ansible

Usage

docker pull nickvth/dockerfile-ansible
cd /tmp/
git clone https://github.com/nickvth/dockerfile-ansible.git 
cd dockerfile-ansible
docker build --force-rm=true --no-cache=true -t nickvth/dockerfile-ansible .
mkdir -p /mnt/ansible
alias ansible='docker run -it --rm=true -v /mnt/ansible:/mnt nickvth/dockerfile-ansible /usr/bin/ansible'
ansible --version
ansible --help
ansible -i hosts testansible -k -m setup 
alias ansible-playbook='docker run -it --rm=true -v /mnt/ansible:/mnt nickvth/dockerfile-ansible /usr/bin/ansible-playbook'
ansible-playbook --version
ansible-playbook --help

Set your alias in .bash_profile, so when you login the alias will be available