blob: b0a7009a2619db86c5e4a87e6d072cb8bcfa29dc [file] [log] [blame]
Sergio Slobodriand24189e2017-06-10 23:27:15 -04001---
2- name: Ensure Swarm Master Initialization
3 command: "docker swarm init --advertise-addr {{ swarm_master_addr }}"
4 when: target == "swarm-master"
5 tags: [swarm]
6
7- name: Capture Swarm Cluster Manager Token
8 become: voltha
9 shell: ssh -i /home/voltha/.keys/{{ swarm_master_addr }} voltha@{{ swarm_master_addr }} sudo docker swarm join-token -q manager 2>/dev/null
10 register: manager_token
11 changed_when: false
12 when: target == "swarm-master-backup"
13 tags: [swarm]
14
15- name: Debug
16 debug:
17 msg: "TOKEN: {{ manager_token.stdout }}"
18 when: target == "swarm-master-backup"
19 tags: [swarm]
20
21- name: Join Swarm Cluster
22 command: "docker swarm join --token {{ manager_token.stdout }} {{ swarm_master_addr }}:2377"
23 when: target == "swarm-master-backup"
24 tags: [swarm]