Fixed some swarm-related bugs
parent
a68aa78972
commit
be6e60bb97
2
main.yml
2
main.yml
|
@ -4,9 +4,9 @@
|
|||
become: yes
|
||||
roles:
|
||||
- install-base-packages
|
||||
- docker
|
||||
- net-security
|
||||
- set-hostname
|
||||
- docker
|
||||
tags: base
|
||||
|
||||
- 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
|
||||
groups: docker
|
||||
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
|
||||
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.
|
||||
community.general.ufw:
|
||||
default: deny
|
||||
|
|
Loading…
Reference in New Issue