Compare commits

...

7 Commits

Author SHA1 Message Date
0e8abb4d38 Merge pull request 'chore 📦: Update file path for non-clustered environments in fail2ban.yml' (#52) from dev into main
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
Mark stale issues and pull requests / stale (push) Successful in 3s
Reviewed-on: #52
2026-03-02 19:03:49 +01:00
ded4fb8270 chore 📦: Update file path for non-clustered environments in fail2ban.yml
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 15s
Gitleaks Scan / gitleaks (push) Successful in 5s
Markdown Lint / markdown-lint (push) Successful in 5s
ai-reviews / Review PR (pull_request) Successful in 12s
PR check / Gitleaks (pull_request) Successful in 4s
PR check / lint tests (pull_request) Successful in 15s
PR check / labeler (pull_request) Successful in 3s
PR check / handle_failures (pull_request) Has been skipped
PR check / handle_success (pull_request) Successful in 2s
This commit updates the file path configuration for non-clustered environments in the `fail2ban.yml` file. This ensures that the correct paths are used when running fail2ban outside of a clustered environment.
2026-03-02 19:02:18 +01:00
0bfe448b34 Merge pull request 'refactor ♻️: Check for firewall file existence before debugging' (#51) from dev into main
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 12s
Gitleaks Scan / gitleaks (push) Successful in 4s
Markdown Lint / markdown-lint (push) Successful in 6s
Mark stale issues and pull requests / stale (push) Successful in 2s
Reviewed-on: #51
2026-03-01 20:05:15 +01:00
38831f981a refactor ♻️: Check for firewall file existence before debugging
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 12s
Gitleaks Scan / gitleaks (push) Successful in 4s
Markdown Lint / markdown-lint (push) Successful in 5s
ai-reviews / Review PR (pull_request) Successful in 11s
PR check / Gitleaks (pull_request) Successful in 4s
PR check / lint tests (pull_request) Successful in 15s
PR check / labeler (pull_request) Successful in 2s
PR check / handle_failures (pull_request) Has been skipped
PR check / handle_success (pull_request) Successful in 2s
Refactored the code to include a conditional check for the existence of the firewall file before proceeding with debugging. This ensures that the debugging process is only initiated when necessary, preventing unnecessary operations and potential errors.
2026-03-01 20:03:52 +01:00
d963c0ec00 Merge pull request 'refactor ♻️: Refactor task names and improve formatting in fail2ban.yml' (#50) from dev into main
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 11s
Gitleaks Scan / gitleaks (push) Successful in 4s
Markdown Lint / markdown-lint (push) Successful in 6s
Reviewed-on: #50
2026-03-01 13:00:44 +01:00
d2761bd840 refactor ♻️: Refactor task names and improve formatting in fail2ban.yml
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 12s
Gitleaks Scan / gitleaks (push) Successful in 4s
Markdown Lint / markdown-lint (push) Successful in 8s
ai-reviews / Review PR (pull_request) Successful in 13s
PR check / Gitleaks (pull_request) Successful in 5s
PR check / lint tests (pull_request) Successful in 16s
PR check / labeler (pull_request) Successful in 2s
PR check / handle_failures (pull_request) Has been skipped
PR check / handle_success (pull_request) Successful in 1s
This commit refactors the task names for better readability and consistency. Additionally, it improves the formatting of the YAML file to enhance maintainability.
2026-03-01 12:59:08 +01:00
c8fb6e4c80 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.
2026-03-01 12:56:54 +01:00

View File

@@ -152,10 +152,16 @@
{{
'/etc/pve/firewall/cluster.fw'
if clustered.stat.exists
else '/etc/pve/nodes/' + pve_node + '.fw'
else '/etc/pve/nodes/' + pve_node + '/host.fw'
}}
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
#################################################
@@ -172,15 +178,19 @@
register: fw_content
when: fw_stat.stat.exists | default(false)
- name: fail2ban | Debug config contents
ansible.builtin.debug:
msg: >
{{ fw_content }}
when: fw_stat.stat.exists | default(false)
- name: fail2ban | Determine if firewall enabled
ansible.builtin.set_fact:
pve_firewall_enabled: >-
{{
(fw_stat.stat.exists | default(false)) and
(
(fw_content.content | default('') | b64decode)
is search('enable:\s*1')
)
fw_stat.stat.exists and
(fw_content.content | b64decode)
is search('^enable:\s*1$', multiline=True)
}}
- name: fail2ban | Warn if firewall not enabled