refactor ♻️: Refactor fail2ban.yml to use fw_compile_check.rc for failure checks
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 13s
Gitleaks Scan / gitleaks (push) Successful in 4s
Markdown Lint / markdown-lint (push) Successful in 5s

This refactoring updates the fail2ban configuration to utilize a new script, `fw_compile_check.rc`, for handling failure checks. This change aims to streamline the process and improve reliability by centralizing the logic in a dedicated script.
This commit is contained in:
2026-02-25 17:59:13 +01:00
parent 734a9c031f
commit 9e90c67fe8

View File

@@ -88,7 +88,7 @@
ansible.builtin.command: pve-firewall compile
register: compiled_fw
changed_when: false
failed_when: fw_compile_check.rc != 0
failed_when: compiled_fw.rc != 0
when: cluster_status.stat.exists
- name: fail2ban | Fail if corosync ports are being dropped
@@ -171,8 +171,8 @@
ansible.builtin.command: pve-firewall compile
when: ipset_change.changed or rule_change.changed
changed_when: false
failed_when: fw_compile_check.rc != 0
register: fw_compile_check
failed_when: fw_compile_check.rc != 0
# Then automatically whitelist it in Fail2Ban:
# ignoreip = 127.0.0.1/8 {{ corosync_ip.stdout }}