Ask Your Question
0

Use local template

asked 2015-03-19 14:47:36 -0500

Ankush Garg gravatar image

How can use the erb template from the puppet agent and not on the puppet master. Also can I execute a command on agent rather than on master like to get file names in directory on agent?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-03-25 14:07:54 -0500

WhatsARanjit gravatar image

Agent ERBs are not supported. Because ERBs are evaluated during catalog compilation on the master, the ERB must be available on the master. Also, calling ERBs with the template() function supports environment, meaning using the call:

template("${module_name}/template.erb")

...may evaluate to a different template based on the environment's modulepath. In order to send any information about the agent to the master, you want to design custom facts. For example if you consider:

$ facter rubysitedir
/Library/Ruby/Site/2.0.0

This is an example fact that's providing a directory location to the master in case it needs to use it when compiling a catalog. Check out http://docs.puppetlabs.com/facter/lat... for the full reference on custom facts.

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

Stats

Asked: 2015-03-19 14:47:36 -0500

Seen: 110 times

Last updated: Mar 25 '15