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
|
# File 'manifests/init.pp', line 18
class genders (
Boolean $manage_repo = true,
String $package_name = 'genders',
String $package_ensure = 'installed',
Stdlib::Absolutepath $config_path = '/etc/genders',
Hash $nodes = {},
) {
if dig($facts, 'os', 'family') == 'RedHat' {
if $manage_repo {
include epel
Yumrepo['epel'] -> Package['genders']
}
}
package { 'genders':
ensure => $package_ensure,
name => $package_name,
}
concat { '/etc/genders':
ensure => 'present',
path => $config_path,
owner => 'root',
group => 'root',
mode => '0644',
validate_cmd => 'nodeattr -f % -k',
require => Package['genders'],
}
concat::fragment { '/etc/genders.header':
target => '/etc/genders',
content => "# File managed by Puppet\n",
order => '01',
}
$nodes.each |$name, $node| {
genders::node { $name: * => $node }
}
}
|