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
|
# File 'manifests/slave.pp', line 14
define smokeping::slave (
String[1] $display_name,
Integer[0] $color,
Optional[String[1]] $location = undef,
$master = 'default',
) {
File {
owner => root,
group => root,
mode => '0644',
}
$random_value = stdlib::fqdn_rand_string(60)
file { $smokeping::shared_secret:
mode => '0600',
owner => $smokeping::daemon_user,
group => $smokeping::daemon_group,
content => $random_value,
}
@@concat::fragment { "${facts['networking']['fqdn']}-secret":
target => $smokeping::slave_secrets,
order => 10,
content => "${title}:${random_value}\n",
tag => "smokeping-slave-secret-${master}",
}
$filename = "${smokeping::slave_dir}/${facts['networking']['fqdn']}"
@@file { $filename:
content => epp("${module_name}/slave.epp",
{
'slave_name' => $title,
'display_name' => $display_name,
'color' => $color,
'location' => $location,
}
),
tag => "smokeping-slave-${master}",
}
@@concat::fragment { $name:
order => 20,
target => '/etc/smokeping/config.d/Slaves',
content => "@include ${filename}\n",
tag => "smokeping-slave-${master}",
}
}
|