Compare commits
7 Commits
a18dda51ac
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e8abb4d38 | |||
| ded4fb8270 | |||
| 0bfe448b34 | |||
| 38831f981a | |||
| d963c0ec00 | |||
| d2761bd840 | |||
| c8fb6e4c80 |
@@ -152,10 +152,16 @@
|
|||||||
{{
|
{{
|
||||||
'/etc/pve/firewall/cluster.fw'
|
'/etc/pve/firewall/cluster.fw'
|
||||||
if clustered.stat.exists
|
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)
|
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 +178,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: fw_stat.stat.exists | default(false)
|
||||||
|
|
||||||
- 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
|
||||||
|
|||||||
Reference in New Issue
Block a user