refactor ♻️: Refactor fail2ban.yml to use fw_compile_check.rc for failure checks
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:
@@ -88,7 +88,7 @@
|
|||||||
ansible.builtin.command: pve-firewall compile
|
ansible.builtin.command: pve-firewall compile
|
||||||
register: compiled_fw
|
register: compiled_fw
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: fw_compile_check.rc != 0
|
failed_when: compiled_fw.rc != 0
|
||||||
when: cluster_status.stat.exists
|
when: cluster_status.stat.exists
|
||||||
|
|
||||||
- name: fail2ban | Fail if corosync ports are being dropped
|
- name: fail2ban | Fail if corosync ports are being dropped
|
||||||
@@ -171,8 +171,8 @@
|
|||||||
ansible.builtin.command: pve-firewall compile
|
ansible.builtin.command: pve-firewall compile
|
||||||
when: ipset_change.changed or rule_change.changed
|
when: ipset_change.changed or rule_change.changed
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: fw_compile_check.rc != 0
|
|
||||||
register: fw_compile_check
|
register: fw_compile_check
|
||||||
|
failed_when: fw_compile_check.rc != 0
|
||||||
|
|
||||||
# Then automatically whitelist it in Fail2Ban:
|
# Then automatically whitelist it in Fail2Ban:
|
||||||
# ignoreip = 127.0.0.1/8 {{ corosync_ip.stdout }}
|
# ignoreip = 127.0.0.1/8 {{ corosync_ip.stdout }}
|
||||||
|
|||||||
Reference in New Issue
Block a user