nixos-servers/legacy/projects/docker_swarm/ansible/playbooks/setup-nixos.yml
Pim Kunis 17f110b183 add two nixos-managed VMs for docker swarm
change docker swarm ansible to target these vms
2024-02-04 17:16:41 +01:00

23 lines
554 B
YAML

---
- name: Setup Docker Swarm manager
hosts: manager
tasks:
- name: Create Docker Swarm
docker_swarm:
- name: Get Docker Swarm manager info
docker_swarm_info:
nodes: yes
nodes_filters:
name: manager
register: swarm_info
- hosts: workers
tasks:
- name: Join Docker Swarm
docker_swarm:
state: join
join_token: "{{ hostvars.manager.swarm_info.swarm_facts.JoinTokens.Worker }}"
remote_addrs:
- "{{ hostvars.manager.ansible_default_ipv4.address }}"