2019-08-24 10:55:56 +00:00
|
|
|
---
|
|
|
|
- name: init swarm cluster
|
2021-11-22 10:28:13 +00:00
|
|
|
community.docker.docker_swarm:
|
2021-11-22 10:43:06 +00:00
|
|
|
advertise_addr: '{{ swarm_advertise_addr }}'
|
2019-08-24 10:55:56 +00:00
|
|
|
state: present
|
2021-11-22 13:38:49 +00:00
|
|
|
when: swarm_manager and swarm_init
|
|
|
|
register: result
|
2021-11-22 10:43:06 +00:00
|
|
|
tags: swarm
|
2019-08-24 10:55:56 +00:00
|
|
|
|
|
|
|
- name: join swarm cluster
|
2022-04-07 07:54:39 +00:00
|
|
|
community.docker.docker_swarm: # noqa no-handler
|
2021-11-22 10:43:06 +00:00
|
|
|
advertise_addr: '{{ swarm_advertise_addr }}'
|
2021-11-22 13:38:49 +00:00
|
|
|
join_token: '{{ swarm_manager|ternary(swarm_join_token_manager, swarm_join_token_worker) }}'
|
2021-11-22 10:43:06 +00:00
|
|
|
remote_addrs: '{{ swarm_remote_addrs }}'
|
2019-08-24 10:55:56 +00:00
|
|
|
state: join
|
2021-11-22 13:38:49 +00:00
|
|
|
when: not result.changed
|
2021-11-22 10:43:06 +00:00
|
|
|
tags: swarm
|