Skip to content

Instantly share code, notes, and snippets.

@ivomarino
Last active July 11, 2017 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ivomarino/578926aa102d523a8e39036b4a12ed5f to your computer and use it in GitHub Desktop.
Save ivomarino/578926aa102d523a8e39036b4a12ed5f to your computer and use it in GitHub Desktop.
ansinble-values
conf_docker_containers:
portainer:
image: portainer/portainer
state: started
restart_policy: always
# published_ports: "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- name: provision docker containers
docker_container:
name: "{{ item.key }}"
state: "{{ item.value.state }}"
image: "{{ item.value.image }}"
restart_policy: "{{ item.value.restart_policy }}"
published_ports: "{{ item.value.published_ports|default([]) }}"
volumes: "{{ item.value.volumes|default([]) }}"
with_dict: '{{ conf_docker_containers }}'
ignore_errors: yes
tags: [ docker, docker-conf, containers ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment