This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
homeserver-ansible/tasks/firewall.yml

38 lines
623 B
YAML

- name: Install firewall packages
community.general.pacman:
name:
- ufw
- name: Deny all ports
community.general.ufw:
policy: deny
- name: Allow service ports
community.general.ufw:
rule: allow
port: "{{ item }}"
proto: tcp
state: enabled
with_items:
- "{{ sshd_port }}"
- http
- https
# Matrix federation port
- 8448
- name: Allow DNS port to LAN
community.general.ufw:
rule: allow
port: 53
proto: any
state: enabled
src: "{{ local_subnet }}"
- name: Enable firewall service
service:
name: ufw
state: started
enabled: yes