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
|
# File 'manifests/boolean.pp', line 16
define selinux::boolean (
Variant[Boolean, Enum['on', 'off', 'present', 'absent']] $ensure = 'on',
Boolean $persistent = true,
) {
include selinux
Anchor['selinux::module post']
-> Selinux::Boolean[$title]
-> Anchor['selinux::end']
$ensure_real = $ensure ? {
true => 'on',
false => 'off',
default => $ensure,
}
$value = $ensure_real ? {
/(?i-mx:on|present)/ => 'on',
/(?i-mx:off|absent)/ => 'off',
default => undef,
}
# Do nothing unless SELinux is enabled
if $facts['os']['selinux']['enabled'] {
selboolean { $name:
value => $value,
persistent => $persistent,
}
}
}
|