| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 # == Type: fail2ban::filter | 1 # == Type: fail2ban::filter |
| 2 # | 2 # |
| 3 # Manage filter information and files for any custom filter. | 3 # Manage filter information and files for any custom filter. |
| 4 # | 4 # |
| 5 # == Parameters: | 5 # == Parameters: |
| 6 # | 6 # |
| 7 # [*regexes*] | 7 # [*regexes*] |
| 8 # Array of strings containing the regular expressions applied to | 8 # Array of strings containing the regular expressions applied to |
| 9 # the filter. | 9 # the filter. |
| 10 # | 10 # |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 # | 23 # |
| 24 define fail2ban::filter ( | 24 define fail2ban::filter ( |
| 25 $regexes = [], | 25 $regexes = [], |
| 26 $ensure = 'present', | 26 $ensure = 'present', |
| 27 ) { | 27 ) { |
| 28 | 28 |
| 29 include fail2ban | 29 include fail2ban |
| 30 include stdlib | 30 include stdlib |
| 31 | 31 |
| 32 if (size($regexes) == 0) and ($ensure == 'present') { | 32 if (size($regexes) == 0) and ($ensure == 'present') { |
| 33 fail("An array of one or more regular expressions is needed if you want", | 33 fail("An array of one or more regular expressions is needed.") |
| 34 » "to create a filter file.") | |
|
mathias
2016/12/01 09:28:30
Please do not personalized messages ("you"). There
f.lopez
2016/12/01 10:16:04
Acknowledged.
| |
| 35 } | 34 } |
| 36 | 35 |
| 37 file {"/etc/fail2ban/filter.d/$title.conf": | 36 # The $name parameter is used to compose the file name. |
|
mathias
2016/12/01 09:28:30
Please use $name (and document that this parameter
f.lopez
2016/12/01 10:16:04
Acknowledged.
| |
| 37 file {"/etc/fail2ban/filter.d/$name.conf": | |
| 38 ensure => $ensure, | 38 ensure => $ensure, |
| 39 content => template("fail2ban/filter.erb"), | 39 content => template("fail2ban/filter.erb"), |
| 40 group => 'root', | 40 group => 'root', |
| 41 mode => '0644', | 41 mode => '0644', |
| 42 owner => 'root', | 42 owner => 'root', |
| 43 require => Package['fail2ban'], | 43 require => Package['fail2ban'], |
| 44 notify => Service['fail2ban'], | 44 notify => Service['fail2ban'], |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| LEFT | RIGHT |