mirror of
https://gitlab.com/rusty-bever/deployment.git
synced 2026-04-08 11:55:47 +02:00
Moved ansible stuff to own folder
This commit is contained in:
parent
868acbc08f
commit
fb5bb177ca
33 changed files with 1 additions and 22 deletions
40
ansible/roles/networking/tasks/main.yml
Normal file
40
ansible/roles/networking/tasks/main.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
- name: Install fail2ban & ufw.
|
||||
apt:
|
||||
name:
|
||||
- fail2ban
|
||||
- ufw
|
||||
state: present
|
||||
|
||||
# TODO add proper fail2ban config
|
||||
|
||||
- name: Ensure fail2ban is started & enabled.
|
||||
service:
|
||||
name: fail2ban
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Ensure ufw is started & enabled.
|
||||
service:
|
||||
name: fail2ban
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Allow SSH connections.
|
||||
community.general.ufw:
|
||||
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
|
||||
- 9001 # Portainer communication
|
||||
|
||||
- name: Block everything else by default & enable firewall.
|
||||
community.general.ufw:
|
||||
default: deny
|
||||
state: enabled
|
||||
Loading…
Add table
Add a link
Reference in a new issue