OLD | NEW |
(Empty) | |
| 1 # == Type: fail2ban::filter |
| 2 # |
| 3 # Manage filter information and files for any custom filter. |
| 4 # |
| 5 # == Parameters: |
| 6 # |
| 7 # [*failregex*] |
| 8 # The regular expressions applied to the filter. |
| 9 # |
| 10 # [*ensure*] |
| 11 # A boolean to ensure the state of the file. |
| 12 # |
| 13 # === Examples: |
| 14 # |
| 15 # filters => { |
| 16 # 'wordpress' => { |
| 17 # failregex => [ |
| 18 # '^<HOST>.*\"WordPress\/.*', |
| 19 # ], |
| 20 # } |
| 21 # }, |
| 22 define fail2ban::filter ( |
| 23 $failregex = undef, |
| 24 $ensure = 'present', |
| 25 ) { |
| 26 |
| 27 include fail2ban |
| 28 include stdlib |
| 29 |
| 30 if ($failregex != undef) and ($ensure == 'present') { |
| 31 file {"/etc/fail2ban/filter.d/$title.conf": |
| 32 ensure => $ensure, |
| 33 content => template("fail2ban/filter.erb"), |
| 34 group => 'root', |
| 35 mode => '0644', |
| 36 owner => 'root', |
| 37 require => Package['fail2ban'], |
| 38 notify => Service['fail2ban'], |
| 39 } |
| 40 } |
| 41 } |
OLD | NEW |