init
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
decentral1se
2022-05-30 14:02:36 +02:00
commit 3b698b9133
13 changed files with 164 additions and 0 deletions

33
tasks/main.yml Normal file
View File

@ -0,0 +1,33 @@
---
- name: Update the package cache
apt:
update_cache: true
cache_valid_time: 3600
- name: Install ufw
apt:
name: ufw
- name: "Allow access on ports: {{ ufw_allow_ports | join(' ') }}"
ufw:
rule: allow
port: "{{ item }}"
proto: tcp
state: enabled
with_items: "{{ ufw_allow_ports }}"
notify: Restart ufw
- name: "Disallow access on ports: {{ ufw_disallow_ports | join(' ') }}"
ufw:
rule: deny
port: "{{ item }}"
with_items: "{{ ufw_disallow_ports }}"
notify: Restart ufw
- name: Default policy deny
ufw:
policy: deny
- name: Enable the firewall
ufw:
state: enabled