Fixed some swarm-related bugs

gitea-rework
Jef Roosens 2021-12-12 22:34:38 +01:00
parent a68aa78972
commit be6e60bb97
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
5 changed files with 28 additions and 1 deletions

View File

@ -4,9 +4,9 @@
become: yes
roles:
- install-base-packages
- docker
- net-security
- set-hostname
- docker
tags: base
- name: Initialize Docker swarm.

View File

@ -0,0 +1,4 @@
{
"metrics-addr" : "0.0.0.0:9323",
"experimental" : true
}

View File

@ -0,0 +1,5 @@
---
- name: restart docker
service:
name: docker
state: restarted

View File

@ -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

View File

@ -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