Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/fail2ban/manifests/filter.pp

Issue 29364214: Issue 2487 - Introduce fail2ban module (Closed)
Patch Set: For comments 18 and 19 Created Dec. 1, 2016, 10:16 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | modules/fail2ban/manifests/init.pp » ('j') | modules/fail2ban/manifests/init.pp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # == Type: fail2ban::filter
2 #
3 # Manage filter information and files for any custom filter.
4 #
5 # == Parameters:
6 #
7 # [*regexes*]
8 # Array of strings containing the regular expressions applied to
9 # the filter.
10 #
11 # [*ensure*]
12 # Translates directly into the state of the file resource.
13 #
14 # === Examples:
15 #
16 # fail2ban::filter {'CVE-2013-0235':
17 # regexes => [
18 # '^<HOST>.*\"WordPress\/.*',
19 # '^.*\"WordPress\/.*<HOST>.*',
20 # ],
21 # 'ensure' => 'present',
22 # }
23 #
24 define fail2ban::filter (
25 $regexes = [],
26 $ensure = 'present',
27 ) {
28
29 include fail2ban
30 include stdlib
31
32 if (size($regexes) == 0) and ($ensure == 'present') {
33 fail("An array of one or more regular expressions is needed.")
34 }
35
36 # The $name parameter is used to compose the file name.
37 file {"/etc/fail2ban/filter.d/$name.conf":
38 ensure => $ensure,
39 content => template("fail2ban/filter.erb"),
40 group => 'root',
41 mode => '0644',
42 owner => 'root',
43 require => Package['fail2ban'],
44 notify => Service['fail2ban'],
45 }
46 }
47
OLDNEW
« no previous file with comments | « no previous file | modules/fail2ban/manifests/init.pp » ('j') | modules/fail2ban/manifests/init.pp » ('J')

Powered by Google App Engine
This is Rietveld