Hiera Tutorials

1,417 views
Skip to first unread message

Kelsey Hightower

unread,
Jun 28, 2012, 12:32:03 PM6/28/12
to puppet...@googlegroups.com
I'm beginning the process of creating Hiera tutorials covering the following topics:

Beginner
  • Getting Started with Hiera (draft)
  • Understanding hierarchies, sources, and scope
  • Understanding answer resolution (array, priority, hash, resolution order, etc)
  • Hiera and Puppet - Using the parser functions and data bindings for parameterized classes
Advanced
  • Hiera backends -- Creating new backends
  • Hiera parser functions -- Creating new hiera parser functions

If you can think of anything else that should be covered let me know.

Thanks.

Kelsey Hightower

unread,
Jun 28, 2012, 12:32:47 PM6/28/12
to puppet...@googlegroups.com
I need to add the following 'cookbook' style tutorials:
  • Hiera and custom Facter Facts
  • Using Hiera data in Puppet manifests - looping over hashes and arrays
  • Creating resources from Hiera data
  • Hiera CLI vs Parser Functions -- how do they match up
  • Hiera Ruby API

windowsrefund

unread,
Jun 28, 2012, 12:59:33 PM6/28/12
to Puppet Users
Brilliant initiative!

windowsrefund

unread,
Jun 28, 2012, 1:01:09 PM6/28/12
to Puppet Users
Are you sure Hiera defaults to /etc/hiera.yaml and not /etc/puppet/
hiera.yaml?

Kelsey Hightower

unread,
Jun 28, 2012, 1:20:42 PM6/28/12
to puppet...@googlegroups.com
On Thu, Jun 28, 2012 at 1:01 PM, windowsrefund <window...@gmail.com> wrote:
Are you sure Hiera defaults to /etc/hiera.yaml and not /etc/puppet/
hiera.yaml?

Yep, the hiera parser functions default to /etc/puppet/hiera.yaml, but Hiera defaults to /etc/hiera.yaml. Most people are not use to running Hiera in stand-alone mode and is commonly the source of confusion.
 

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.




--
Kelsey Hightower
Developer
Puppet Labs

Tim Mooney

unread,
Jun 29, 2012, 5:42:50 PM6/29/12
to puppet...@googlegroups.com
In regard to: [Puppet Users] Hiera Tutorials, Kelsey Hightower said (at...:

> I'm beginning the process of creating Hiera tutorials covering the
> following topics:
>
> *Beginner*
>
> - Getting Started with Hiera (draft<https://github.com/kelseyhightower/hiera/blob/maint/1.0rc/add_getting_started_tutorial/docs/tutorials/getting_started.md>
> )
> - Understanding hierarchies, sources, and scope
> - Understanding answer resolution (array, priority, hash, resolution
> order, etc)
> - Hiera and Puppet - Using the parser functions and data bindings for
> parameterized classes
>
> *Advanced*
>
> - Hiera backends -- Creating new backends
> - Hiera parser functions -- Creating new hiera parser functions
>

This is fantastic news Kelsey and I'm really looking forward to it.

We've been using hiera with the community edition for about 6 months,
and we're really happy with it, but we're really not using it to its
full potential yet.

One area where there's a dearth of documentation (and best practices
recommendations) relates to how to "namespace" settings within hiera.
What I mean is that when we converted from extlookup() to hiera, we
took the easy route, so we now have stuff in hiera that looks like:

nameserver_type: client
nameserver_primary: XXX.YYY.ZZZ.AAA
nameserver_secondary: XXX.YYY.ZZZ.BBB
nameserver_tertiary: XXX.YYY.ZZZ.CCC

Hiera would support something like

nameserver:
type: client
servers:
- XXX.YYY.ZZZ.AAA
- XXX.YYY.ZZZ.BBB
- XXX.YYY.ZZZ.CCC

in other words, more complicated data structures.

Both recommendations on whether or not that's a good idea *and* examples
on how to successfully access the nested bits from within puppet would
be appreciated.

Advanced examples with create_resources() might also be useful.

Thanks much,

Tim
--
Tim Mooney Tim.M...@ndsu.edu
Enterprise Computing & Infrastructure 701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
Reply all
Reply to author
Forward
0 new messages