Add docker-swarm setup

This commit is contained in:
Marty Oehme 2021-07-27 13:07:42 +02:00
parent 578f8b7dbf
commit 7e99f97958
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 18 additions and 4 deletions

View file

@ -1,10 +1,7 @@
---
- hosts: all
tasks:
- name: Test connection
ansible.builtin.ping:
- hosts: all
roles:
- system-upgrade
- docker
- docker-swarm

View file

@ -0,0 +1,17 @@
---
# Bring up a docker swarm
# needs community docker module installed:
# run $`ansible-galaxy collection install community.docker`
- name: Ensure swarm is initialized
community.docker.docker_swarm:
state: present
# advertise_addr: eth1 # necessary for testing setup on vagrant
become: true
- name: Ensure public network exists
community.docker.docker_network:
name: public
driver: overlay
state: present
become: true