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
|
# File 'manifests/facter/conf.pp', line 8
class pupmod::facter::conf (
Stdlib::Absolutepath $facter_conf_dir = $::pupmod::facter_conf_dir,
Hash $facter_options = $::pupmod::facter_options
) {
assert_private()
file { $facter_conf_dir:
ensure => 'directory',
owner => 'root',
group => 'root',
mode => '0755'
}
$_facter_conf = "${facter_conf_dir}/facter.conf"
file {$_facter_conf:
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0644'
}
$facter_options.each |String $section, Hash $config| {
if empty($config) {
hocon_setting { $section:
ensure => absent,
path => $_facter_conf,
setting => $section,
require => File[$facter_conf_dir]
}
} else {
hocon_setting { $section:
ensure => present,
path => $_facter_conf,
setting => $section,
value => $config,
require => File[$facter_conf_dir]
}
}
}
}
|