How to load variables into a puppet manifest from file?

asked 2016-08-01 01:30:01 -0500

wdcapl gravatar image

Hi Guys,

My manifest has lots of variables I would like to load from a ini file, so a newbie can easily modify them.

Any ideas how to do it?

Thanks for help!

edit retag flag offensive close merge delete



I believe Hiera can do what you want.

maynero gravatar imagemaynero ( 2016-08-01 19:29:42 -0500 )edit

I second using hiera to load data into your puppet code. That is the industry standard way of doing it. There are ways that you could hack together a function to read a file from the classpath to create a hash with key/value pairs for all of your variables... but please don't do that!

DarylW gravatar imageDarylW ( 2016-08-02 09:12:05 -0500 )edit

Ok. Thank you guys. I'll try to figure out hiera.

wdcapl gravatar imagewdcapl ( 2016-08-03 08:58:19 -0500 )edit

You mean class parameters, don't you?

Kai Burghardt gravatar imageKai Burghardt ( 2016-09-03 19:34:14 -0500 )edit