puppetlabs / control-repo

A control repository template
Apache License 2.0
204 stars 510 forks source link

Update hiera.yaml defaults #106

Closed davidsandilands closed 2 years ago

davidsandilands commented 2 years ago

A default data_hash matches our documentation better https://puppet.com/docs/puppet/7/hiera_config_yaml_5.htm

reidmv commented 2 years ago

I think in this case, what this repo has is more correct, and the documentation is what should be adjusted to match.

Keys such as data_hash: and lookup_key: are (unfortunately) kind of a poor UX choice, and really should have just been called type: since what they indicate is what kind of data lookup is going to be used for paths (or URIs) listed by this Hierarchy entry. As such, it is clearest to read and understand if every Hierarchy entry has a type:-equivalent value. In practice, this doesn't cause many extra lines of configuration because it's more typical to have a single hierarchy entry with multiple paths than to have many hierarchy entries with one path or only a few paths.

davidsandilands commented 2 years ago

@reidmv what actually confused me here was the example at https://puppet.com/docs/puppet/7/hiera_config_yaml_5.html#config_syntax which usually names out all the sources with no grouping of paths more like the example at https://github.com/voxpupuli/hiera-eyaml is what id expect. I'll close this and have a chew over not sure if doc example is just a bit unusual as i have sent it more typically as vox do.

reidmv commented 2 years ago

Yeah, I think the Vox example is more typical. What we should do is update the docs to reflect that.