Create swarm
This commit is contained in:
@@ -25,3 +25,45 @@
|
||||
serial: 100%
|
||||
tasks:
|
||||
- include: ../roles/developer-machine/tasks/main.yml
|
||||
|
||||
- name: Initialize the swarm
|
||||
hosts: swarm-bootstrap
|
||||
user: root
|
||||
gather_facts: true
|
||||
serial: 100%
|
||||
vars:
|
||||
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
|
||||
tasks:
|
||||
- include_tasks: ../tasks/swarm-bootstrap.yml
|
||||
|
||||
- name: Add additional managers to the swarm
|
||||
hosts: swarm-managers
|
||||
user: root
|
||||
gather_facts: false
|
||||
serial: 100%
|
||||
vars:
|
||||
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
|
||||
vars:
|
||||
join_addr:
|
||||
"{{ hostvars[groups['swarm-bootstrap'][0]].ansible_eth0.ipv4.address }}"
|
||||
manager_key:
|
||||
"{{ hostvars[groups['swarm-bootstrap'][0]]['manager_key']['stdout'] }}"
|
||||
tasks:
|
||||
- include_tasks: ../tasks/swarm-manager.yml
|
||||
|
||||
|
||||
- name: Add workers to the swarm
|
||||
hosts: swarm-workers
|
||||
user: root
|
||||
gather_facts: false
|
||||
serial: 100%
|
||||
vars:
|
||||
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
|
||||
vars:
|
||||
join_addr:
|
||||
"{{ hostvars[groups['swarm-bootstrap'][0]].ansible_eth0.ipv4.address }}"
|
||||
worker_key:
|
||||
"{{ hostvars[groups['swarm-bootstrap'][0]]['worker_key']['stdout'] }}"
|
||||
tasks:
|
||||
- include_tasks: ../tasks/swarm-worker.yml
|
||||
|
||||
|
||||
Reference in New Issue
Block a user