From the course: Learning Puppet
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Hiera basics - Puppet Tutorial
From the course: Learning Puppet
Hiera basics
Hiera is a tool for working with data in Puppet. Take a look at this little snippet of Puppet code. It looks pretty innocuous, right? We're creating three user accounts. Now imagine instead of three users, you had 30 or 300. What looks like reasonable code suddenly seems pretty unmanageable. Instead of including data like a list of users in the code, we can use Hiera to abstract that away. This lets us focus on what our Puppet code does and not get muddled up mixing data in with the code. Obviously, this is only half the picture, because that lookup function needs to get the data from somewhere. Hiera is a tool that comes with Puppet. Its name comes from the word hierarchy, so if you're wondering how to pronounce it, just say it the same as you would usually say hierarchy. Hiera works by allowing you to set a hierarchical lookup for your data, so that more specific data can override more general. It might be easier to understand with a visual aid. Imagine that this is the default…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.