check firewalld exists before stopping to avoid error on minimal installs

This commit is contained in:
2026-06-14 17:35:44 +07:00
parent 1c5e669824
commit 9afc923bc5

View File

@@ -35,12 +35,18 @@
replace: 'SELINUX=permissive'
# ── Firewalld ─────────────────────────────────────────────────────
- name: Check if firewalld is installed
command: systemctl list-unit-files firewalld.service
register: firewalld_check
changed_when: false
failed_when: false
- name: Disable and stop firewalld
systemd:
name: firewalld
enabled: false
state: stopped
ignore_errors: true # may not be installed
when: "'firewalld.service' in firewalld_check.stdout"
# ── Swap ──────────────────────────────────────────────────────────
- name: Disable swap now