Fixed some swarm-related bugs
parent
a68aa78972
commit
be6e60bb97
2
main.yml
2
main.yml
|
@ -4,9 +4,9 @@
|
||||||
become: yes
|
become: yes
|
||||||
roles:
|
roles:
|
||||||
- install-base-packages
|
- install-base-packages
|
||||||
- docker
|
|
||||||
- net-security
|
- net-security
|
||||||
- set-hostname
|
- set-hostname
|
||||||
|
- docker
|
||||||
tags: base
|
tags: base
|
||||||
|
|
||||||
- name: Initialize Docker swarm.
|
- name: Initialize Docker swarm.
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"metrics-addr" : "0.0.0.0:9323",
|
||||||
|
"experimental" : true
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- name: restart docker
|
||||||
|
service:
|
||||||
|
name: docker
|
||||||
|
state: restarted
|
|
@ -58,3 +58,12 @@
|
||||||
name: debian
|
name: debian
|
||||||
groups: docker
|
groups: docker
|
||||||
append: true
|
append: true
|
||||||
|
|
||||||
|
- name: Enable metric endpoint for Prometheus
|
||||||
|
copy:
|
||||||
|
src: daemon.json
|
||||||
|
dest: /etc/docker/daemon.json
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '644'
|
||||||
|
notify: restart docker
|
||||||
|
|
|
@ -24,6 +24,15 @@
|
||||||
rule: allow
|
rule: allow
|
||||||
port: 2222
|
port: 2222
|
||||||
|
|
||||||
|
- name: Open necessary ports for Docker swarm communication.
|
||||||
|
community.general.ufw:
|
||||||
|
rule: allow
|
||||||
|
port: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- 2377 # cluster management communications
|
||||||
|
- 7946 # communication among nodes
|
||||||
|
- 4789 # overlay network traffic
|
||||||
|
|
||||||
- name: Block everything else by default & enable firewall.
|
- name: Block everything else by default & enable firewall.
|
||||||
community.general.ufw:
|
community.general.ufw:
|
||||||
default: deny
|
default: deny
|
||||||
|
|
Loading…
Reference in New Issue