params.pp vs Hiera

345 views
Skip to first unread message

Sergiu Cornea

unread,
Sep 9, 2015, 8:45:05 AM9/9/15
to Puppet Users
Hello guys,

I was wondering if someone can explain the difference between using the params.pp file and Hiera, as in my opinion they achieve the same thing using different methods.

For example, in the params.pp file you declare all or almost all the variables that are going to be used in your module and then call then in each manifest that you are using them and by using Hiera you declare the variables as you go in your manifest and set them using the Hiera file for that node.

Thank you,

Regards,
Sergiu

Dan White

unread,
Sep 9, 2015, 11:48:10 AM9/9/15
to puppet...@googlegroups.com
Your observation is on target. 
Now consider a module that has to support multiple operating systems, multiple locations, et cetera, ad infinitum. You can either have a whopping huge params.pp file that contains all the logic and possibilities, or you set up Hiera to pick and choose for you, completely outside of your module and, IMNSHO, much easier to maintain.

This message and its attachments are private and confidential. If you have received this message in error, please notify the sender and remove it and its attachments from your system.

The University of Westminster is a charity and a company limited by guarantee. Registration number: 977818 England. Registered Office: 309 Regent Street, London W1B 2UW.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/308289d5-90b4-4dfb-b9e8-6afc687fa85a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Alfke

unread,
Sep 9, 2015, 12:16:46 PM9/9/15
to puppet...@googlegroups.com
As a module developer I want to provide a module which will do sane defaults without forcing users to hiera.
Module developer (at the moment) put OS and application defaults into params.pp.
As a user you might want to override these defaults and specify them either as a parameter or via hiera.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6319666A-A094-45DF-88D5-415188B60A18%40icloud.com.

Rich Burroughs

unread,
Sep 9, 2015, 1:31:48 PM9/9/15
to puppet...@googlegroups.com
I recommend this post on Gary Larizza's blog:

http://garylarizza.com/blog/2013/12/08/when-to-hiera/


Rich
Reply all
Reply to author
Forward
0 new messages