1
2
3
4
5
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
# Class Shorewall init for puppet shorewall module.
class shorewall (
$ensure = 'true',
$purge = false,
$intes = $undef,
$rules = $undef,
$shorewall_dir_path = $::shorewall::params::shorewall_dir_path,
$shorewall_dir_owner = $::shorewall::params::shorewall_dir_owner,
$shorewall_dir_group = $::shoreall::params::shorewall_dir_group,
$shorewall_dir_mode = $::shorewall::params::shoreall_dir_mode,
$recurse = true,
$cluster = 'default',
$public_interface = nil,
$private_interface = nil,
) inherits ::shorewall::params {
file { $shorewall_dir_path:
ensure => 'directory',
owner => $shorewall_dir_owner,
group => $shoreawll_dir_group,
mode => $shoreawll_dir_mode,
purge => $purge,
force => true,
recurse => $recurse,
}
case $facts['os']['name'] {
'RedHat', 'CentOS': {
file {'/etc/yum.repos.d/epel.repo':
ensure => 'file',
source => 'puppet:///modules/shorewall/epel.repo',
group => 'root',
owner => 'root',
mode => '0644',
}
}
default: {
}
}
package {'shorewall':
ensure => latest,
allow_virtual => false,
}
file {"/etc/shorewall/shorewall.conf":
ensure => 'file',
source => "puppet:///modules/shorewall/shorewall-${cluster}.conf",
purge => $purge,
notify => Service['shorewall'],
}
file {"/etc/shorewall/README.txt":
ensure => 'file',
source => 'puppet:///modules/shorewall/README.txt',
}
file {"/etc/shorewall/interfaces":
ensure => 'file',
owner => $shorewall_dir_owner,
group => $shorewall_dir_group,
mode => $shorewall_dir_mode,
content => template("shorewall/interfaces.erb"),
notify => Service['shorewall'],
}
file {"/etc/shorewall/policy":
ensure => 'file',
owner => $shorewall_dir_owner,
group => $shorewall_dir_group,
mode => $shorewall_dir_mode,
source => "puppet:///modules/shorewall/policy-${cluster}",
purge => $purge,
notify => Service['shorewall'],
}
file {"/etc/shorewall/zones":
ensure => 'file',
owner => $shorewall_dir_owner,
group => $shorewall_dir_group,
mode => $shorewall_dir_mode,
source => "puppet:///modules/shorewall/zones-${cluster}",
purge => $purge,
notify => Service['shorewall'],
}
file {"/etc/shorewall/rules":
ensure => 'file',
owner => $shorewall_dir_owner,
group => $shorewall_dir_group,
mode => $shorewall_dir_mode,
content => template("shorewall/rules.erb"),
notify => Service['shorewall'],
}
service {"shorewall":
ensure => true,
enable => true,
hasrestart => true,
hasstatus => true,
}
}
|