Ask Your Question

custom environment variables in puppet templates

asked 2014-02-05 01:49:43 -0600

admin gravatar image

updated 2014-02-05 01:50:08 -0600

I want to access custom env variables in puppet templates and i also don't want to use FACTER.

I know if we do

FACTER_variable = 'value'

then we can access it in template but I want to declare env variable as a global env variable like in some bashrc file.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2014-02-05 03:48:20 -0600

nibalizer gravatar image

Do you mean an environment variable on the agent or on master?

Either way, stepping outside Facter on this will be an uphill battle. If you can centralize the data into a yaml file or database, you could use hiera to feed that data into your templates.

Also remember that template evaluation happens on the master.

edit flag offensive delete link more

answered 2015-06-23 07:04:04 -0600

To know all things about puppet templateyou can read this official documentation of puppetlabs:

It briefly describes about accessing custom environment variables and other things. I hope that you will find the exact solution there as per your desire. Good Luck!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-02-05 01:49:43 -0600

Seen: 712 times

Last updated: Feb 05 '14