Ask Your Question

Revision history [back]

The classes hash should hold an array. eg:

 classes:
   - vmwaretools
   - apache
   - mysql

That document appears to be outdated. Take a look at http://docs.puppetlabs.com/hiera/1/puppet.html#assigning-classes-to-nodes-with-hiera-hierainclude.

The classes hash should hold an array. eg:

 classes:
   - vmwaretools
   - apache
   - mysql

That document appears to be outdated. Take a look at http://docs.puppetlabs.com/hiera/1/puppet.html#assigning-classes-to-nodes-with-hiera-hierainclude.Assigning Classes to Nodes with hiera_include.

The classes hash should hold an array. eg:

 classes:
   - vmwaretools
   - apache
   - mysql

That document appears to be outdated. Take a look at Assigning Classes to Nodes with hiera_include.

EVERTHING in YAML is a hash:

 1.8.7-p374 :003 > YAML.load('classes: vmwaretools')
    => {"classes"=>"vmwaretools"}

 1.8.7-p374 :007 > YAML.load("classes:
 1.8.7-p374 :008">   - vmwaretools")
    => {"classes"=>["vmwaretools"]}

The classes hash should hold an array. eg:

 classes:
   - vmwaretools
   - apache
   - mysql

That document appears to be outdated. Take a look at Assigning Classes to Nodes with hiera_include.

EVERTHING in YAML is a hash:

 1.8.7-p374 :003 > YAML.load('classes: vmwaretools')
    => {"classes"=>"vmwaretools"}

 1.8.7-p374 :007 > YAML.load("classes:
 1.8.7-p374 :008">   - vmwaretools")
    => {"classes"=>["vmwaretools"]}

As far as the interpolating facts in hiere or puppet for that matter, the :: denotes that the variable is in the top-scope. You can keep the :: off of the variable name but that does not follow the Puppet Style Guide.

 class foo (
   $host = $::hostname #valid and follows the style guide
   ....

 class foo (
   $host $hostname #also valid but does not follow the style guide

Namespacing the variables avoids scoping issues.

Hiera:

 foo::bar: "%{::hostname}" #valid
 bar::baz: "%{hostname}" #also valid but does not follow style guidelines

The classes hash should hold an array. eg:

 classes:
   - vmwaretools
   - apache
   - mysql

That document appears to be outdated. Take a look at Assigning Classes to Nodes with hiera_include.

EVERTHING in YAML is a hash:

 1.8.7-p374 :003 > YAML.load('classes: vmwaretools')
    => {"classes"=>"vmwaretools"}

 1.8.7-p374 :007 > YAML.load("classes:
 1.8.7-p374 :008">   - vmwaretools")
    => {"classes"=>["vmwaretools"]}

As far as the interpolating facts in hiere or puppet for that matter, the :: denotes that the variable is in the top-scope. You can keep the :: off of the variable name but that does not follow the Puppet Style Guide.

 class foo (
   $host = $::hostname #valid and follows the style guide
   ....

 class foo (
   $host = $hostname #also valid but does not follow the style guide

Namespacing the variables avoids scoping issues.

Hiera:

 foo::bar: "%{::hostname}" #valid
 bar::baz: "%{hostname}" #also valid but does not follow style guidelines

The classes hash should hold an array. eg:

 classes:
   - vmwaretools
   - apache
   - mysql

That document appears to be outdated. Take a look at Assigning Classes to Nodes with hiera_include.

EVERTHING in YAML is a hash:

 1.8.7-p374 :003 > YAML.load('classes: vmwaretools')
    => {"classes"=>"vmwaretools"}

 1.8.7-p374 :007 > YAML.load("classes:
 1.8.7-p374 :008">   - vmwaretools")
    => {"classes"=>["vmwaretools"]}

As far as the interpolating facts in hiere or puppet for that matter, the :: denotes that the variable is in the top-scope. You can keep the :: off of the variable name but that does not follow the Puppet Style Guide.

 class foo (
   $host = $::hostname #valid and follows the style guide
   ....

 class foo (
   $host = $hostname #also valid but does not follow the style guide

Namespacing the variables avoids scoping issues.

Hiera:

 foo::bar: "%{::hostname}" #valid
 bar::baz: "%{hostname}" #also valid but does not follow style guidelines

And finally. If you are interpolating facts/variables into the :hierarchy: YAML hash you do need to wrap it in double quotes as stated in Hiera 1: Iterpolation Tokens.