Sha256: d9dd685090f47b0246365f1901446b410d03d651354ca9fe64bfd9d227fd7e88

Contents?: true

Size: 913 Bytes

Versions: 69

Compression:

Stored size: 913 Bytes

Contents

# Takes a key to lookup in the installation answers file
# - If it's a hash, declare a class with those parameters
# - If it's true or "true" declare the default parameters for that class
# - If it's false or "false" ignore it
# - Otherwise fail with error
#
define kafo_configure::yaml_to_class {

  $classname = class_name($name)

  if is_hash($kafo_configure::params[$name]) {
    # The quotes around $classname seem to matter to puppet's parser...
    $params = { "${classname}" => $kafo_configure::params[$name] }
    create_resources( 'class', $params )
  } elsif $kafo_configure::params[$name] == true {
    $params = { "${classname}" => {} }
    create_resources( 'class', $params )
  } elsif ! $kafo_configure::params[$name] or $kafo_configure::params[$name] == "false" {
    debug("${::hostname}: not including $name")
  } else {
    fail("${::hostname}: unknown type of answers data for $name")
  }

}

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
kafo-0.6.2 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.6.1 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.6.0 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.5.5 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.5.4 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.5.3 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.17 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.5.2 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.5.1 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.5.0 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.4.0 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.16 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.15 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.14 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.13 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.12 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.11 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.10 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.9 modules/kafo_configure/manifests/yaml_to_class.pp
kafo-0.3.8 modules/kafo_configure/manifests/yaml_to_class.pp