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
|
# File 'manifests/webmin_pkg.pp', line 1
class webmin::webmin_pkg (
$webmin_port = $webmin::webmin_port,
$csf = $webmin::csf,
$ensure = $webmin::ensure,
$ssl = $webmin::ssl,
$ssl_pkg = $webmin::ssl_pkg,
) inherits webmin {
package { 'webmin':
ensure => $ensure,
}
ensure_packages(["$ssl_pkg"])
if ( $bind_ip != 'UNSET' ) {
$changes = [
"set ssl $ssl",
"set port $webmin_port",
"rm listen",
"set bind $bind_ip",
]
} else {
$changes = [
"set ssl $ssl",
"set port $webmin_port",
"set listen $webmin_port",
"rm bind",
]
}
augeas { 'webmin_miniserv':
context => "/files/etc/webmin/miniserv.conf",
changes => $changes,
notify => Service['webmin'],
require => Package['webmin'],
}
service { 'webmin':
ensure => running,
enable => true,
subscribe => Package['webmin'],
}
if ( $csf == true ) {
File {
require => Package['webmin'],
notify => Service['webmin'],
}
file { '/usr/libexec/webmin/csf':
ensure => directory,
owner => '0',
group => 'bin',
mode => '0755',
}
file { '/usr/libexec/webmin/csf/csfimages':
ensure => link,
target => '/usr/local/csf/lib/webmin/csf/images',
}
file { '/usr/libexec/webmin/csf/index.cgi':
ensure => link,
target => '/usr/local/csf/lib/webmin/csf/index.cgi',
}
file { '/usr/libexec/webmin/csf/module.info':
ensure => link,
target => '/usr/local/csf/lib/webmin/csf/module.info',
}
webmin::acl { 'firewall':
action => delete,
}
webmin::acl { 'csf':
action => add,
}
} else {}
}
|