feat : Add debug tasks for Proxmox firewall config path and contents
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 13s
Gitleaks Scan / gitleaks (push) Successful in 5s
Markdown Lint / markdown-lint (push) Successful in 5s
ai-reviews / Review PR (pull_request) Successful in 15s
PR check / Gitleaks (pull_request) Successful in 5s
PR check / lint tests (pull_request) Failing after 17s
PR check / labeler (pull_request) Successful in 2s
PR check / handle_failures (pull_request) Successful in 1s
PR check / handle_success (pull_request) Has been skipped

This commit introduces new debug tasks to help diagnose issues related to the Proxmox firewall configuration path and its contents. These tasks will assist in verifying that the paths are correctly set up and that the necessary files are present.
This commit is contained in:
2026-03-01 12:56:54 +01:00
parent 54f3f761c8
commit c8fb6e4c80

View File

@@ -156,6 +156,13 @@
}} }}
when: pve_installed.stat.exists | default(false) when: pve_installed.stat.exists | default(false)
- name: fail2ban | show firewall config path
ansible.builtin.debug:
msg: >
WARNING: Proxmox firewall config path is:
{{ pve_firewall_config}}
when: pve_firewall_config is defined
################################################# #################################################
# Detect firewall configuration # Detect firewall configuration
################################################# #################################################
@@ -172,15 +179,19 @@
register: fw_content register: fw_content
when: fw_stat.stat.exists | default(false) when: fw_stat.stat.exists | default(false)
- name: fail2ban | debug config contents
ansible.builtin.debug:
msg: >
{{ fw_content }}
when: not pve_firewall_enabled
- name: fail2ban | Determine if firewall enabled - name: fail2ban | Determine if firewall enabled
ansible.builtin.set_fact: ansible.builtin.set_fact:
pve_firewall_enabled: >- pve_firewall_enabled: >-
{{ {{
(fw_stat.stat.exists | default(false)) and fw_stat.stat.exists and
( (fw_content.content | b64decode)
(fw_content.content | default('') | b64decode) is search('^enable:\s*1$', multiline=True)
is search('enable:\s*1')
)
}} }}
- name: fail2ban | Warn if firewall not enabled - name: fail2ban | Warn if firewall not enabled