Ask Your Question
0

puppet command in custom function

asked 2016-01-18 05:14:07 -0500

I would like to run a puppet command such as "puppet --version" as a custom function and use the command output in the module. Unfortunately it looks like every other command on the system works properly except for "puppet" and even when using the full path of the puppet executable the command still does not work.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-02-07 18:58:17 -0500

Henrik Lindberg gravatar image

You can use $serverfacts['serverversion'] to get the puppet version of the server, and $facts['clientversion'] to get the version of the cliet (i.e. the agent). There is no need trying to do that by running "puppet --version" in a function.

See the documentation(https://docs.puppetlabs.com/puppet/latest/reference/langfactsandbuiltinvars.html) for more details about $server_facts, and $facts as well as what is available in different versions of puppet.

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

Stats

Asked: 2016-01-18 05:14:07 -0500

Seen: 46 times

Last updated: Jan 18 '16