Swarm setup doesn't require root
parent
b21aea7621
commit
9f520126f6
|
@ -1 +1,3 @@
|
|||
.vagrant/
|
||||
|
||||
*hosts.ini
|
||||
|
|
3
main.yml
3
main.yml
|
@ -11,21 +11,18 @@
|
|||
|
||||
- name: Initialize Docker swarm.
|
||||
hosts: admin
|
||||
become: yes
|
||||
roles:
|
||||
- docker-swarm-init
|
||||
tags: swarm
|
||||
|
||||
- name: Add managers to swarm.
|
||||
hosts: managers
|
||||
become: yes
|
||||
roles:
|
||||
- docker-swarm-add-manager
|
||||
tags: swarm
|
||||
|
||||
- name: Add workers to swarm.
|
||||
hosts: workers
|
||||
become: yes
|
||||
roles:
|
||||
- docker-swarm-add-worker
|
||||
tags: swarm
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
register: node_state
|
||||
shell: "docker info --format '{{ '{{' }}.Swarm.LocalNodeState{{ '}}' }}'"
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
|
||||
- name: Add managers to the swarm
|
||||
shell: >
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
register: node_state
|
||||
shell: "docker info --format '{{ '{{' }}.Swarm.LocalNodeState{{ '}}' }}'"
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
|
||||
- name: Add worker to swarm.
|
||||
register: join_cmd
|
||||
|
|
Loading…
Reference in New Issue