Add role for adding docker nodes to swarm

This commit is contained in:
2021-11-10 21:59:04 -05:00
parent 8c69b7af95
commit a0be654b92
8 changed files with 217 additions and 9 deletions

View 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