Defined Type: clustershell::group_yaml

Defined in:
manifests/group_yaml.pp

Summary

Manage a group yaml file

Overview

Examples:

clustershell::group_yaml { 'roles':
  data => {
    'roles' => {
      'compute' => 'compute[01-04]',
      'login'   => 'login[01-02]',
    }
  }
}

Parameters:

  • ensure (Enum['present','absent','file']) (defaults to: 'present')

    File ensure property

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

    The data to use in defining the YAML groups

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

    Source that can be used to define the YAML file

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

    Content that can override this module's template for this YAML file



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
# File 'manifests/group_yaml.pp', line 21

define clustershell::group_yaml (
  Enum['present','absent','file'] $ensure = 'present',
  Hash $data = {},
  Optional[String] $source = undef,
  Optional[String] $content = undef,
) {
  include clustershell

  $path = "${clustershell::groups_auto_dir}/${name}.yaml"

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

  file { "clustershell::group_yaml ${name}":
    ensure  => $ensure,
    path    => $path,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => $_content,
    source  => $source,
  }
}