update fail2ban playbook

This commit is contained in:
Ruben Blanco 2024-02-14 17:45:42 +01:00
parent cc11f440b7
commit a6d21ffd4a
2 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,8 @@ resolvs:
################################################################################ ################################################################################
### FAIL2BAN #################################################################### ### FAIL2BAN ####################################################################
fail2ban_enabled: True
#fail2ban_enabled: False
fail2ban_times: fail2ban_times:
bantime: "604800" bantime: "604800"
maxretry: "4" maxretry: "4"

View File

@ -7,6 +7,12 @@
tasks: tasks:
- name: "[CONFIG FAIL2BAN] Comprobando si es necesario configurar fail2ban "
debug:
msg: "No es necesario configurar fail2ban en la máquina"
when: fail2ban_enabled is not defined or not fail2ban_enabled
- name: "[CONFIG FAIL2BAN] Install and configure fail2ban service" - name: "[CONFIG FAIL2BAN] Install and configure fail2ban service"
import_role: import_role:
name: config-fail2ban name: config-fail2ban
when: fail2ban_enabled is defined and fail2ban_enabled