...
 
Commits (4)
......@@ -19,6 +19,13 @@ containers: []
# - "/sys:/sys:ro"
# - "/var/lib/docker/:/var/lib/docker:ro"
networks: []
# networks:
# - name: ipv6_network
# enable_ipv6: yes
# ipam_config:
# - subnet: fd00:0001:0001::/48
registries: []
# registries:
# - username: user
......
......@@ -4,7 +4,7 @@ dependencies: []
galaxy_info:
role_name: containers
author: Filip Chabik (hadret)
description: Wrapper role on top of docker_container and docker_login.
description: Wrapper role on top of docker_container, docker_network and docker_login.
license: MIT
min_ansible_version: 2.7
platforms:
......@@ -18,4 +18,5 @@ galaxy_info:
galaxy_tags:
- containers
- docker
- networks
- registry
---
- include_tasks: registries.yml
when: registries
when: registries | length > 0
- include_tasks: networks.yml
when: networks | length > 0
- include_tasks: containers.yml
when: containers
when: containers | length > 0
---
- name: setup the network(s)
docker_network:
name: '{{ item.name }}'
api_version: '{{ item.api_version | default("auto") }}'
appends: '{{ item.appends | default("no") }}'
attachable: '{{ item.attachable | default(omit) }}'
ca_cert: '{{ item.ca_cert | default(omit) }}'
client_cert: '{{ item.client_cert | default(omit) }}'
client_key: '{{ item.client_key | default(omit) }}'
connected: '{{ item.connected | default(omit) }}'
debug: '{{ item.debug | default("no") }}'
docker_host: '{{ item.docker_host | default(omit) }}'
driver: '{{ item.driver | default(omit) }}'
driver_options: '{{ item.driver_options | default(omit) }}'
enable_ipv6: '{{ item.enable_ipv6 | default(omit) }}'
force: '{{ item.force | default("no") }}'
internal: '{{ item.internal | default(omit) }}'
ipam_config: '{{ item.ipam_config | default(omit) }}'
ipam_driver: '{{ item.ipam_driver | default(omit) }}'
ipam_driver_options: '{{ item.ipam_driver_options | default(omit) }}'
labels: '{{ item.labels | default(omit) }}'
scope: '{{ item.scope | default(omit) }}'
ssl_version: '{{ item.ssl_version | default(omit) }}'
state: '{{ item.state | default("present") }}'
timeout: '{{ item.timeout | default("60") }}'
tls: '{{ item.tls | default("no") }}'
tls_hostname: '{{ item.tls_hostname | default("localhost") }}'
validate_certs: '{{ item.validate_certs | default("no") }}'
no_log: true
loop: "{{ networks }}"
when: networks is defined