Swarm setup doesn't require root

gitea-rework
Jef Roosens 2021-12-13 11:59:34 +01:00
parent b21aea7621
commit 9f520126f6
Signed by: Jef Roosens
GPG Key ID: 955C0660072F691F
4 changed files with 4 additions and 3 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
.vagrant/ .vagrant/
*hosts.ini

View File

@ -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

View File

@ -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: >

View File

@ -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