Puppet Class: genders

Defined in:
manifests/init.pp

Summary

Manage genders

Overview

Examples:

include genders

Parameters:

  • manage_repo (Boolean) (defaults to: true)

    Boolean that sets of repo for genders should be managed Currently only impacts Red Hat based systems

  • package_name (String) (defaults to: 'genders')

    Genders package name

  • package_ensure (String) (defaults to: 'installed')

    Genders package ensure property

  • config_path (Stdlib::Absolutepath) (defaults to: '/etc/genders')

    Path to genders file

  • nodes (Hash) (defaults to: {})

    Hash used to define genders::node resources.



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 }
  }

}