Skip to content
An ansible docker connection example.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Using a docker connection with ansible

This contains an example of an ansible playbook that starts up a docker container using docker-machine and uses an ansible docker connection to do the machine setup.

# initialize docker-machine
docker-machine start local
eval "$(docker-machine env local)"

# run the playbook using the dynamic inventory
ansible-playbook -i playbook.yml

# check docker running containers
docker ps

# connect to running instance
docker exec -it XXXXXXX bash

You can read more about it on this blog post.


Oscar Brito

You can’t perform that action at this time.