lab-ansible/roles/common/tasks/firewall.yml

16 lines
333 B
YAML

# vim: ft=yaml.ansible
# code: language=ansible
---
- name: Allow necessary ports in UFW
community.general.ufw:
to_port: "{{ item.port }}"
proto: "{{ item.proto }}"
comment: "{{ item.comment }}"
rule: allow
loop: "{{ open_ports }}"
- name: Enable UFW
community.general.ufw:
policy: deny
state: enabled