This repository has been archived on 2022-07-05. You can view files and clone it, but cannot push or open issues or pull requests.
autonomic.swarm-single-node/tasks/main.yml

38 lines
1003 B
YAML
Raw Normal View History

2022-05-30 14:57:39 +00:00
---
- 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