Skip to content

divhide/example-ansible-docker-connection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

23a0e1a · May 10, 2016

History

3 Commits
May 9, 2016
May 9, 2016
May 10, 2016
May 9, 2016
May 9, 2016

Repository files navigation

Divhide

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 docker-machine.py 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.

Author

Oscar Brito