Ask Your Question

Revision history [back]

This is possibly a typo in the PuppetLabs documentation, which can be confusing for those of us who are new to Hiera and YAML.

As a best practice, one should always specify top-scope variables with a ::, which is the recommended practice in the [Puppet style guide for namespacing variables|http://docs.puppetlabs.com/guides/style_guide.html#namespacing-variables]:

11.6. Namespacing Variables

When using top-scope variables, including facts, Puppet modules should explicitly specify the empty namespace to prevent accidental scoping issues.

Good:

$::operatingsystem

Bad:

$operatingsystem

I spoke to someone in IRC, and they filed two tickets:

  • https://tickets.puppetlabs.com/browse/DOCUMENT-126
  • https://tickets.puppetlabs.com/browse/HI-278

This is possibly appears to be a typo in the PuppetLabs documentation, which can be confusing for those of us who are new to Hiera and YAML.

As a best practice, one should always specify top-scope variables with a ::, which is the recommended practice in the [Puppet style guide for namespacing variables|http://docs.puppetlabs.com/guides/style_guide.html#namespacing-variables]:

11.6. Namespacing Variables

When using top-scope variables, including facts, Puppet modules should explicitly specify the empty namespace to prevent accidental scoping issues.

Good:

$::operatingsystem

Bad:

$operatingsystem

I spoke to someone in IRC, and they filed two tickets:

  • https://tickets.puppetlabs.com/browse/DOCUMENT-126
  • https://tickets.puppetlabs.com/browse/HI-278