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
|
# File 'manifests/init.pp', line 11
class hosts (
Hash[String[1], Hash[String[1], Any]] $entries = {},
Hash[String[1], Hash[String[1], Any]] $default_entries = {},
Boolean $purge = true,
Boolean $manage_fqdn = true,
) {
$all_hosts = $default_entries + $entries
$all_hosts.each |$n, $params| {
host { $n:
* => $params,
}
}
if $purge {
resources { 'host':
purge => true,
}
}
if $manage_fqdn {
host { $facts['networking']['fqdn']:
ensure => present,
ip => $facts['networking']['ip'],
host_aliases => $facts['networking']['hostname'],
}
}
}
|