Files
noofac-snackpot/roles/ufw/tasks/main.yml
2021-12-03 17:59:35 +00:00

30 lines
484 B
YAML

---
- name: install base packages
apt:
name: ufw
state: present
update_cache: true
- name: deny all incoming traffic
ufw:
policy: deny
direction: incoming
- name: allow all outgoing traffic
ufw:
policy: allow
direction: outgoing
- name: allow incoming traffic for ssh and web server
ufw:
rule: allow
direction: in
to_port: "{{ item }}"
proto: tcp
with_items: "{{ ufw_allow_in }}"
- name: enable ufw
ufw:
state: enabled