From e49e94e448dcbd7a2303f1255c27dc98656b7ba4 Mon Sep 17 00:00:00 2001 From: rubenb Date: Tue, 17 Oct 2023 15:10:41 +0200 Subject: [PATCH] create role fail2ban --- linux/base-config-debian/base-config-debian.yaml | 8 +++++++- linux/base-config-debian/fail2ban-config.yaml | 12 ++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 linux/base-config-debian/fail2ban-config.yaml diff --git a/linux/base-config-debian/base-config-debian.yaml b/linux/base-config-debian/base-config-debian.yaml index 54ef407..8cdeafb 100644 --- a/linux/base-config-debian/base-config-debian.yaml +++ b/linux/base-config-debian/base-config-debian.yaml @@ -22,7 +22,12 @@ name: base-config-debian-os tags: base-os_config - - name: "[NAGIOS NRPE] Install and configure nagios nrpe" + - name: "[FAIL2BAN CONFIG] Install and configure fail2ban service" + import_role: + name: configure-fail2ban + tags: fail2ban-config_config + + - name: "[NAGIOS NRPE] Install and configure nagios nrpe service" import_role: name: nagios-nrpe tags: nagios-nrpe_config @@ -58,6 +63,7 @@ handlers: - create-awx-user-and-config - hardnening-config-root-user - base-config-debian-os + - configure-fail2ban - nagios-nrpe - server-type - add-repos-vn diff --git a/linux/base-config-debian/fail2ban-config.yaml b/linux/base-config-debian/fail2ban-config.yaml new file mode 100644 index 0000000..a93d6ed --- /dev/null +++ b/linux/base-config-debian/fail2ban-config.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + + - name: "[FAIL2BAN CONFIG] Install and configure fail2ban service" + import_role: + name: configure-fail2ban \ No newline at end of file