Puppet Class: isp3node::fail2ban::setup

Defined in:
manifests/fail2ban/setup.pp

Summary

Setup fail2ban on the future ISPConfig server node

Overview

Installs fail2ban on the host and enables jails as given in the parameters

Examples:

include isp3node::fail2ban::setup

Parameters:

  • jails (Array[String])

    Predefined jails to apply to f2b, see list: forge.puppet.com/puppet/fail2ban/readme#pre-defined-jails

  • servicejails (Hash[String, Array[String]])

    Jails to apply if the services are installed on the node (see fact isp3node::::installed)

  • custom_jails (Optional[Hash[String, Hash]]) (defaults to: {})

    Custom jail definitions to apply to f2b

  • custom_servicejails (Optional[Hash[String, Hash[String, Hash]]]) (defaults to: {})

    Custom jail definitions to apply if the service is installed (see fact isp3node::::installed)



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'manifests/fail2ban/setup.pp', line 15

class isp3node::fail2ban::setup(
  Array[String] $jails,
  Hash[String, Array[String]] $servicejails,
  Optional[Hash[String, Hash]] $custom_jails = {},
  Optional[Hash[String, Hash[String, Hash]]] $custom_servicejails = {},
) {
  $servicejails.each |$s, $j| {
    if($facts['isp3node'][$s][installed]){
      $jails << $j
    }
  }
  $custom_servicejails.each |$s, $j| {
    if($facts['isp3node'][$s][installed]){
      $custom_jails << $j
    }
  }
  class { 'fail2ban':
    package_ensure => 'latest',
    jails          => $jails,
    custom_jails   => $custom_jails,
  }
}