Add role for adding docker nodes to swarm
This commit is contained in:
18
roles/swarm/tasks/main.yaml
Normal file
18
roles/swarm/tasks/main.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Install Docker
|
||||
ansible.builtin.import_tasks: install.yaml
|
||||
|
||||
- name: Configure Docker
|
||||
ansible.builtin.import_tasks: configure.yaml
|
||||
|
||||
# This taskfile will set two facts that will be used in subsequent tasks:
|
||||
# * _docker_swarm_needs_join: a boolean indicating whether the host needs to be joined to the swarm
|
||||
# or is already joined
|
||||
# * _docker_swarm_manager: the inventory hostname of a swarm manager that can be delegated to to
|
||||
# fetch swarm joining info
|
||||
- name: Check swarm state ahead of swarm configuration
|
||||
ansible.builtin.import_tasks: check.yaml
|
||||
|
||||
- name: Join server to swarm
|
||||
when: _docker_swarm_needs_join
|
||||
ansible.builtin.include_tasks: join.yaml
|
||||
Reference in New Issue
Block a user