This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
pi-ansible/roles/os_config/tasks/firewall.yml

19 lines
411 B
YAML
Raw Normal View History

2022-12-22 19:18:27 +00:00
# vim: ft=yaml.ansible
---
- name: Allow necessary ports in UFW
2023-03-22 18:31:21 +00:00
community.general.ufw:
2023-07-23 23:49:10 +00:00
to_port: "{{ item.port }}"
proto: "{{ item.proto }}"
comment: "{{ item.comment }}"
2023-08-01 16:59:53 +00:00
insert: "{{ ansible_loop.index }}"
rule: allow
loop: "{{ open_ports }}"
2023-08-01 16:59:53 +00:00
loop_control:
extended: true
extended_allitems: false
2022-12-22 19:18:27 +00:00
- name: Enable UFW
2023-03-22 18:31:21 +00:00
community.general.ufw:
2022-12-22 19:18:27 +00:00
policy: deny
2023-07-02 00:09:57 +00:00
state: enabled