Files
confdroid_haproxy/manifests/monitoring/fail2ban.pp

40 lines
1.1 KiB
ObjectPascal
Raw Normal View History

# Module name: confdroid_haproxy
2025-02-14 11:36:23 +01:00
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages fail2ban settings
##############################################################################
class confdroid_haproxy::monitoring::fail2ban (
2025-02-14 11:36:23 +01:00
) inherits confdroid_haproxy::params {
2025-02-14 11:36:23 +01:00
if $hy_manage_fail2ban == true {
2026-03-11 14:43:06 +01:00
require confdroid_fail2ban # (external module)
2025-02-14 11:41:18 +01:00
2025-02-14 11:36:23 +01:00
# configure filter
2025-02-22 13:12:45 +01:00
2025-02-14 11:36:23 +01:00
file { '/etc/fail2ban/filter.d/haproxy.conf':
2025-03-02 17:26:09 +01:00
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => etc_t,
seluser => system_u,
content => template('confdroid_haproxy/fail2ban/f2b_haproxy.conf.erb'),
2025-03-02 17:26:09 +01:00
notify => Service['fail2ban'],
2025-02-14 12:01:01 +01:00
}
file { '/etc/fail2ban/jail.d/010-haproxy.conf':
2025-03-02 17:26:09 +01:00
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => etc_t,
seluser => system_u,
content => template('confdroid_haproxy/fail2ban/010_jail.d_haproxy.conf.erb'),
2025-03-02 17:26:09 +01:00
notify => Service['fail2ban'],
2025-02-14 11:36:23 +01:00
}
}
}