38 lines
1003 B
YAML
38 lines
1003 B
YAML
|
---
|
||
|
- name: Ensure mandatory variables are configured
|
||
|
assert:
|
||
|
that: "{{ item }} is defined"
|
||
|
fail_msg: "You must define the '{{ item }}' variable"
|
||
|
with_items:
|
||
|
- members
|
||
|
|
||
|
- name: Include resource variables
|
||
|
include_vars: "{{ members }}"
|
||
|
tags:
|
||
|
# Note(d1): we already load in converge.yml so skip here
|
||
|
- molecule-notest
|
||
|
|
||
|
# Note(decentral1se): Done in this way because Ansible...
|
||
|
# Please see this SO answer https://stackoverflow.com/a/39041069
|
||
|
- name: Include user group tasks
|
||
|
include: group.yml user={{ item }}
|
||
|
with_items: "{{ members }}"
|
||
|
|
||
|
- name: Ensure Docker python dependencies are installed
|
||
|
package:
|
||
|
name: "{{ item }}"
|
||
|
state: present
|
||
|
with_items:
|
||
|
- python3-docker
|
||
|
|
||
|
- name: Initialise docker swarm
|
||
|
docker_swarm:
|
||
|
state: present
|
||
|
advertise_addr: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
|
||
|
|
||
|
- name: Initialise proxy for traefik
|
||
|
docker_network:
|
||
|
name: proxy
|
||
|
driver: overlay
|
||
|
when: swarm_single_node_enable_proxy
|