feat: add firewall rules for nginx and wireguard

This commit is contained in:
Tobias J. Endres 2025-09-03 19:07:51 +02:00
parent 95181b9ed9
commit 789391c6e1
5 changed files with 31 additions and 5 deletions

View File

@ -7,3 +7,4 @@
- common - common
- podman # Ensure podman is configured before network - podman # Ensure podman is configured before network
- network - network
- wireguard

View File

@ -1,5 +1,5 @@
--- - name: Reload firewalld
- name: Restart Nginx ansible.builtin.systemd:
ansible.builtin.shell: name: firewalld
cmd: podman restart {{ nginx_proxy_manager_container_name }} state: reloaded
become: true become: true

View File

@ -5,4 +5,16 @@
owner: root owner: root
group: root group: root
mode: '0644' mode: '0644'
become: true become: true
- name: Open firewall ports for web traffic
ansible.posix.firewalld:
port: "{{ item }}"
permanent: true
state: enabled
zone: public
loop:
- 80/tcp
- 443/tcp
notify: Reload firewalld
become: true

View File

@ -0,0 +1,5 @@
- name: Reload firewalld
ansible.builtin.systemd:
name: firewalld
state: reloaded
become: true

View File

@ -0,0 +1,8 @@
- name: Open firewall port for Wireguard
ansible.posix.firewalld:
port: 51820/udp
permanent: true
state: enabled
zone: public
notify: Reload firewalld
become: true