add fail2ban class

This commit is contained in:
Arne Teuke
2025-02-14 11:36:23 +01:00
parent a6c5d66820
commit 3ed73f6cb6
10 changed files with 38 additions and 119 deletions

View File

@@ -0,0 +1,28 @@
# Module name: cd_haproxy
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages fail2ban settings
##############################################################################
class cd_haproxy::monitoring::fail2ban (
) inherits cd_haproxy::params {
require cd_fail2ban
if $hy_manage_fail2ban == true {
# configure filter
file { '/etc/fail2ban/filter.d/haproxy.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => etc_t,
seluser => system_u,
content => template('cd_haproxy/fail2ban/f2b_haproxy.conf.erb'),
notify => Service[$fn_service],
}
}
}