04.08.25
This commit is contained in:
23
roles/firewall/tasks/main.yml
Normal file
23
roles/firewall/tasks/main.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
- name: Install ufw
|
||||
apt:
|
||||
name: ufw
|
||||
state: present
|
||||
|
||||
- name: Allow SSH
|
||||
ufw:
|
||||
rule: allow
|
||||
port: 22
|
||||
|
||||
- name: Allow HTTP/HTTPS
|
||||
ufw:
|
||||
rule: allow
|
||||
port: "{{ item }}"
|
||||
loop:
|
||||
- 80
|
||||
- 443
|
||||
|
||||
- name: Deny all others
|
||||
ufw:
|
||||
state: enabled
|
||||
policy: deny
|
||||
|
||||
Reference in New Issue
Block a user