What's difference between roles and profiles, ENC and Hiera

718 views
Skip to first unread message

Dhaval

unread,
Mar 31, 2015, 11:16:46 AM3/31/15
to puppet...@googlegroups.com
Hello,

I am starting learning puppet, i want to understand what is the difference between roles and profiles and ENV and Hiera ? are all different ways of assigning classes or data to host ? can you help to give me brief comparison and what's best suited ?

Regards,

Matt Zagrabelny

unread,
Mar 31, 2015, 11:22:10 AM3/31/15
to puppet...@googlegroups.com

Dhaval

unread,
Mar 31, 2015, 11:31:14 AM3/31/15
to puppet...@googlegroups.com
Thanks, I have seen some of those, if someone can brief me when to use what appreciate that ..

jcbollinger

unread,
Apr 1, 2015, 9:41:19 AM4/1/15
to puppet...@googlegroups.com


On Tuesday, March 31, 2015 at 10:31:14 AM UTC-5, Dhaval wrote:
Thanks, I have seen some of those, if someone can brief me when to use what appreciate that ..


Hiera is a framework for maintaing machine- and site-specific data outside your Puppet manifests, and for serving it to the catalog builder at need.  It is the mechanism underlying Puppet's "automatic data binding" feature for choosing values for class parameters, but it can also be used directly in your manifests via various Puppet functions.

"ENV" is not meaningful as a Puppet concept, but perhaps you  meant "external node classifier" (ENC).  An ENC is, yes, a mechanism for assigning classes (and data) to nodes.  Use of an ENC is optional.  It can work instead of a site manifest, but more usually is used alongside a site manifest.  Almost everything you can do via an ENC, you can do via Hiera, too.  If you are not using one of the products that provides a Puppet ENC (The Foreman or Puppet Enterprise, for example), then I would forget about ENCs for the moment and focus on Hiera.

"Roles and Profiles" is a popular pattern for your site configuration.  In that pattern, "roles" correspond to high-level operational roles that a machine may have, such as "Web Server" or "Development Workstation", whereas profiles model the low-level details of how to manage a particular subsystem or role for a particular type of machine.  Roles and Profiles are both modeled as Puppet classes, with role classes doing nothing but including the appropriate profile classes.  Nodes are then classified with one (or perhaps more) role classes.  None of this is directly related to HIera or ENCs, but they can work together.


John

Dhaval

unread,
Apr 1, 2015, 11:23:56 AM4/1/15
to puppet...@googlegroups.com
Thanks for your time in explaining,  what i understand is "roles and profiles" is different from Hiera and ENC which is used for providing data only. Let me search for example where Hiera is used and roles and profiles are defined to make difference in data as per the defined profile.

Thanks again, this helps.

Craig Dunn

unread,
Apr 2, 2015, 5:40:33 AM4/2/15
to puppet...@googlegroups.com
On Wed, Apr 1, 2015 at 5:23 PM, Dhaval <d.jo...@gmail.com> wrote:
> Thanks for your time in explaining, what i understand is "roles and
> profiles" is different from Hiera and ENC which is used for providing data
> only. Let me search for example where Hiera is used and roles and profiles
> are defined to make difference in data as per the defined profile.

You are discussing three very different things here, an ENC is, at
it's most basic form, just a classifier that says node X should apply
class Y - though there are much more sophisticated things that one can
do with an ENC, in the scope of this example lets leave it at that.
What class Y actually is, is where roles and profiles come in. Roles
and profiles are merely a design pattern for laying out your classes
to add some layers of abstraction between component modules (the
actual cogs) and roles (business logic) - when people adopt roles and
profiles they tend to classify just the nodes role in the ENC. Hiera
is a different concept entirely and is used to provide hierarchical
data lookups which determine what data values are applied based on a
pre-determined series of overrides that are customized to your
particular environment.

https://www.youtube.com/watch?v=ZpHtOnlSGNY is a talk I did on this
some time ago, and towards the end Hiera and ENCs are touched on

Some of the relevant parts are;

http://www.slideshare.net/PuppetLabs/roles-talk
- #71 Hiera
- #88 ENC
- #92 Stack diagram

Hope this helps.

Regards
Craig


--
Enviatics | Automation and configuration management
http://www.enviatics.com | @Enviatics
Puppet Training http://www.enviatics.com/training/
Reply all
Reply to author
Forward
0 new messages