Puppet Class: confdroid_nagios::monitoring::fail2ban

Inherits:
confdroid_nagios::params
Defined in:
manifests/monitoring/fail2ban.pp

Summary

Class manages fail2ban monitoring for the confdroid_nagios module.

Overview

confdroid_nagios::monitoring::fail2ban.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'manifests/monitoring/fail2ban.pp', line 6

class confdroid_nagios::monitoring::fail2ban (

) inherits confdroid_nagios::params {
  # we want to  create a nagios jail here
  if ($ng_nagios_server == $fqdn)  and ($ng_enable_fail2ban == true) {
    require confdroid_fail2ban

    # create the jail file
    file { $fn_jail_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => etc_t,
      seluser  => system_u,
      content  => template('confdroid_nagios/fail2ban/jail.conf.erb'),
      notify   => Service['fail2ban'],
    }

    # create the filter rule
    file { $fn_filter_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => etc_t,
      seluser  => system_u,
      content  => template('confdroid_nagios/fail2ban/filter.conf.erb'),
      notify   => Service['fail2ban'],
    }
  }
}