feat: add ufw rule
parent
5e2cafaf47
commit
2ebdb06b5e
|
@ -5,7 +5,7 @@
|
||||||
roles:
|
roles:
|
||||||
- 'any.common.python'
|
- 'any.common.python'
|
||||||
- 'any.common.ssh'
|
- 'any.common.ssh'
|
||||||
tags: [base, first]
|
tags: first
|
||||||
|
|
||||||
- hosts: pearl
|
- hosts: pearl
|
||||||
become: true
|
become: true
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
- 'any.common.debian-repositories'
|
- 'any.common.debian-repositories'
|
||||||
- 'any.common.debian-user'
|
- 'any.common.debian-user'
|
||||||
- 'any.tools.default'
|
- 'any.tools.default'
|
||||||
- 'any.tools.docker'
|
- 'any.tools.ufw'
|
||||||
- 'any.tools.restic'
|
- 'any.tools.restic'
|
||||||
- 'any.tools.caddy'
|
- 'any.tools.caddy'
|
||||||
tags: base
|
tags: base
|
||||||
|
|
|
@ -34,3 +34,10 @@
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
- name: Open HTTP ports in firewall
|
||||||
|
community.general.ufw:
|
||||||
|
port: '{{ item }}'
|
||||||
|
rule: 'allow'
|
||||||
|
loop:
|
||||||
|
- 'http'
|
||||||
|
- 'https'
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
- name: Ensure UFW is installed
|
||||||
|
apt:
|
||||||
|
name: ufw
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Set default policy to deny
|
||||||
|
community.general.ufw:
|
||||||
|
default: 'deny'
|
||||||
|
|
||||||
|
- name: Allow SSH connections
|
||||||
|
community.general.ufw:
|
||||||
|
port: 2222
|
||||||
|
rule: 'allow'
|
||||||
|
|
||||||
|
- name: Ensure UFW is enabled
|
||||||
|
community.general.ufw:
|
||||||
|
state: 'enabled'
|
Loading…
Reference in New Issue