blob: d2507af2ffeb588fde2c51be5c8a1514b4d6e4ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
---
- name: Enable Local Swarm Communications
community.general.ufw:
rule: allow
from: "{{ homelab_network }}"
state: enabled
- name: Set swarm initializer variable
ansible.builtin.set_fact:
swarm_initializer_host: "{{ groups['swarm_cluster'][0] }}"
- name: Initialize the swarm cluster on the first node
when: ansible_hostname == swarm_initializer_host
ansible.builtin.import_tasks: swarm_init/tasks/main.yml
- name: Join the swarm cluster on all other nodes
when: ansible_hostname != swarm_initializer_host
ansible.builtin.import_tasks: swarm_join/tasks/main.yml
|