- name: Install packages
community.general.pacman:
name:
- ufw
- name: Deny all ports by default
community.general.ufw:
policy: deny
- name: Allow Matrix federation port
rule: allow
port: 8448
proto: tcp
state: enabled
when: enable_synapse
- name: Allow Syncthing port
port: 22000
proto: any
when: enable_syncthing
- name: Allow http/https ports
port: "{{ item }}"
when: enable_webserver
with_items:
- http
- https
- name: Allow coturn ports (turn/turns)
when: enable_coturn
- turn
- turns
- name: Allow coturn UDP relay ports
port: "49152:65535"
proto: udp
- name: Allow coturn TCP relay ports
- name: Allow ssh port
port: "{{ sshd_port }}"
- name: Allow gitea ssh port
port: "2499"
- name: Allow DNS port to LAN
port: domain
src: "{{ local_subnet }}"
when: enable_nameserver
- name: Enable firewall service
service:
name: ufw
state: started
enabled: yes