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
|
# File 'manifests/user.pp', line 17
class polkit::user (
String[1] $user = 'polkitd',
Hash $user_options = {},
Boolean $report_proc_issues = true
){
assert_private()
$_proc_mount_group = $facts.dig('simplib__mountpoints', '/proc', 'options_hash', '_gid__group')
if $_proc_mount_group {
$_default_user_options = {
'groups' => ([$_proc_mount_group] + $user_options['groups']).filter |$val| { $val =~ NotUndef }
}
}
else {
$_default_user_options = {}
if pick($facts.dig('simplib__mountpoints', '/proc', 'options_hash', 'hidepid'), 0) > 0 {
if $report_proc_issues {
$_hidepid_loglevel = 'warning'
}
else {
$_hidepid_loglevel = 'debug'
}
class { 'polkit::user::hidepid_notify': log_level => $_hidepid_loglevel }
}
}
if $user_options {
$_user_options = $user_options.merge($_default_user_options)
}
else {
$_user_options = $_default_user_options
}
user { $user: * => $_user_options }
}
|