fix(firewalld): adjust firewall only when it's set up

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2024-07-22 10:39:21 +02:00
parent eaaf707b60
commit 9d89a874ec
Signed by: mfocko
SSH key fingerprint: SHA256:icm0fIOSJUpy5+1x23sfr+hLtF9UhY8VpMC7H4WFJP8
3 changed files with 4 additions and 0 deletions

View file

@ -15,6 +15,7 @@
immediate: true immediate: true
permanent: true permanent: true
state: enabled state: enabled
when: ansible_facts.services['firewalld'] is defined
tags: firewall tags: firewall
- name: Enable cups - name: Enable cups

View file

@ -80,6 +80,7 @@
loop: loop:
- http - http
- https - https
when: ansible_facts.services['firewalld'] is defined
tags: firewall tags: firewall
- name: Enable nginx - name: Enable nginx

View file

@ -41,6 +41,7 @@
immediate: true immediate: true
permanent: true permanent: true
state: enabled state: enabled
when: ansible_facts.services['firewalld'] is defined
notify: "Restart SSH server" notify: "Restart SSH server"
tags: firewall tags: firewall
@ -49,6 +50,7 @@
service: ssh service: ssh
permanent: true permanent: true
state: disabled state: disabled
when: ansible_facts.services['firewalld'] is defined
tags: firewall tags: firewall
- name: Set trusted CA - name: Set trusted CA