feat ✨: Add conditional execution for reloading PVE firewall
This commit introduces a new feature that allows conditional execution of the PVE firewall reload command based on certain conditions, enhancing flexibility and control over firewall management.
This commit is contained in:
@@ -35,8 +35,9 @@
|
|||||||
- name: Restart fail2ban
|
- name: Restart fail2ban
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: fail2ban
|
name: fail2ban
|
||||||
state: restarted
|
state: reloaded
|
||||||
|
|
||||||
- name: Reload pve firewall
|
- name: Reload pve firewall
|
||||||
ansible.builtin.command: pve-firewall reload
|
ansible.builtin.command: pve-firewall reload
|
||||||
|
when: fw_compile_check.rc == 0
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|||||||
@@ -148,6 +148,11 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
when: cluster_status.stat.exists
|
when: cluster_status.stat.exists
|
||||||
|
|
||||||
|
- name: Validate Proxmox firewall configuration
|
||||||
|
ansible.builtin.command: pve-firewall compile
|
||||||
|
register: fw_compile_check
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
# 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