This ansible role deploy swarm stacks.
Platform | Versions |
---|---|
Debian | all |
EL | all |
Fedora | all |
Ubuntu | all |
Ansible >= 2.13
None.
ansible-galaxy install dginhoux.docker_stacks
git clone https://github.com/dginhoux/ansible_role.docker_stacks dginhoux.docker_stacks
- hosts: all
tasks:
- name: start role dginhoux.docker_stacks
ansible.builtin.include_role:
name: dginhoux.docker_stacks
Defaults variables defined in defaults/main.yml
swarm_stacks_action: deploy
## rm value is used to force remove all stacks listed in the following list
# swarm_stacks_action: rm
swarm_stacks_list:
- name: registry-cache
state: present
compose: /mnt/gfs_lv_swarm_registry/registry-stack/registry-cache/docker-compose.yml
- name: registry-build
state: present
compose: /mnt/gfs_lv_swarm_registry/registry-stack/registry-build/docker-compose.yml
swarm_overlay_networks_list:
- name: test1
state: present
force: false
scope: swarm
driver: overlay
enable_ipv6: false
attachable: false
internal: false
# labels:
# ipam_config:
# ipam_driver:
# ipam_driver_options:
driver_options:
com.docker.network.bridge.name: test1
- name: test2
state: present
force: false
scope: swarm
driver: overlay
enable_ipv6: false
attachable: false
internal: false
# labels:
# ipam_config:
# ipam_driver:
# ipam_driver_options:
driver_options:
com.docker.network.bridge.name: test2
Those variables files are located in vars/*.yml
are used to handle OS differences.
One of theses is loaded dynamically during role runtime using the include_vars
module and set OS specifics variable's.
NOT USED BY THIS ROLE
Dany GINHOUX - https://github.com/dginhoux
MIT