Last active
October 16, 2015 10:07
-
-
Save shearluck/368d79cefda3c890055f to your computer and use it in GitHub Desktop.
Sample ansible playbook for managing docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run with: | |
# ansible-playbook docker-playbook.yml | |
- hosts: 127.0.0.1 | |
sudo: yes # If in use, add parameter: --ask-sudo-pass | |
tasks: | |
- name: Install docker-py | |
pip: name=docker-py # Install dependency | |
- name: run docker app container | |
docker: | |
docker_api_version: 1.17 # Fix error when docker api and client version don't match | |
name: sample-app # This will be the docker container name | |
image: docker-image # Docker image name | |
net: host # Fix error invalid network mode default | |
state: started |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment