fix: swarm init

This commit is contained in:
2024-06-02 21:27:26 +00:00
parent 7dcb905746
commit 5013c21f7b
2 changed files with 13 additions and 0 deletions

View File

@@ -21,3 +21,7 @@
- name: install netdata
when: docker_netdata_install
include_tasks: netdata.yml
- name: swarm init
when: swarm_init and not live_restore
include_tasks: swarm.yml

9
tasks/swarm.yml Normal file
View File

@@ -0,0 +1,9 @@
---
- name: Check is docker swarm
ansible.builtin.shell: docker service ls 2>&1 > /dev/null | grep "docker swarm init"
register: docker_swarm_mode
ignore_errors: true
- name: Docker Swarm Init
ansible.builtin.shell: docker swarm init
when: docker_swarm_mode.rc == 0