Defined Type: genders::node

Defined in:
manifests/node.pp

Summary

Manage genders node

Overview

Examples:

Define nodes

genders::node { 'compute01':
  attrs => ['compute','rack01'],
}

Define node with Hash attrs

genders::node { 'compute01':
  attrs => { 'class' => 'compute', 'rack' => 'rack01' },
}

Parameters:

  • node (Variant[Array[String], String]) (defaults to: $name)

    The node or nodes to define in genders file

  • attrs (Variant[Array[String],Hash[String,String]]) (defaults to: [])

    Array or Hash of attributes to define for a node

  • content (Optional[String]) (defaults to: undef)

    Optional content to override module template

  • source (Optional[String]) (defaults to: undef)

    Optional Source to override module template

  • order (String) (defaults to: '50')

    Order in genders file for this node



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'manifests/node.pp', line 24

define genders::node (
  Variant[Array[String], String] $node = $name,
  Variant[Array[String],Hash[String,String]] $attrs = [],
  Optional[String] $content = undef,
  Optional[String] $source = undef,
  String $order = '50',
) {
  include genders

  if ! $source and ! $content {
    $_content = template('genders/node.erb')
  } else {
    $_content = $content
  }

  concat::fragment { "/etc/genders.${name}":
    target  => '/etc/genders',
    content => $_content,
    source  => $source,
    order   => $order,
  }
}