Access arrays/hashes in facter 2 facts

facterpuppet

In facter 2 you can now have arrays/hashes as facts.

For example:

os => {
  "name"=>"CentOS",
  "family"=>"RedHat",
  "release"=>{
    "major"=>"7",
    "minor"=>"0",
    "full"=>"7.0.1406"
  }
}

What is the format to access os=>release=>major from a manifest?

Best Answer

For example like this:

notify { $::os[release][major] : }

Note that you need to set the option stringify_facts to false for this to work (default as of writing with Puppet 3.7.1: true).

Related Topic