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