Newer
Older
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
#
# Define an xinetd service in a portable way between Red Hat and Debian.
# Currently, we require all xinetd configurations live in the xinetd module
# until we've finished the transition for Debian systems, but eventually
# modules will provide their own configuration files from their own files
# area.
define base::xinetd::service(
$ensure,
$source = 'NOSRC'
) {
# Used for the file suffix.
case $::operatingsystem {
debian: { $os = $::operatingsystem }
ubuntu: { $os = 'Debian' }
redhat: { $os = "${::operatingsystem}${::lsbmajdistrelease}" }
}
case $ensure {
present: {
case $name {
'eklogin', 'kshell', 'kshd': {
file { "/etc/xinetd.d/$name":
links => follow,
source => $source ? {
NOSRC => "puppet:///modules/base/xinetd/etc/xinetd.d/$name.$os",
default => $source
},
notify => Service['xinetd'],
}
}
default: {
file { "/etc/xinetd.d/$name":
source => $source ? {
NOSRC => "puppet:///modules/base/xinetd/etc/xinetd.d/$name",
default => $source
},
notify => Service['xinetd'],
}
}
}
}
absent: {
file { "/etc/xinetd.d/$name":
ensure => absent,
notify => Service['xinetd'],
}
}
}
}