Add docker-swarm setup
This commit is contained in:
parent
578f8b7dbf
commit
7e99f97958
2 changed files with 18 additions and 4 deletions
|
|
@ -1,10 +1,7 @@
|
||||||
---
|
---
|
||||||
- hosts: all
|
|
||||||
tasks:
|
|
||||||
- name: Test connection
|
|
||||||
ansible.builtin.ping:
|
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
roles:
|
roles:
|
||||||
- system-upgrade
|
- system-upgrade
|
||||||
- docker
|
- docker
|
||||||
|
- docker-swarm
|
||||||
|
|
|
||||||
17
roles/docker-swarm/tasks/main.yml
Normal file
17
roles/docker-swarm/tasks/main.yml
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue