Ask Your Question

is there any way to take input from command line while running puppet manifest?

asked 2014-02-15 04:45:42 -0500

ketan gravatar image

updated 2014-02-15 04:46:42 -0500

while running the puppet manifest can we take input from the command line and use that input in the manifests?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-02-15 12:47:37 -0500

spuder gravatar image

updated 2014-02-19 21:55:41 -0500

Puppet runs are intended to be autonomous and idempotent and executed in a distributed fashion. There is no way to prompt for user input.

You can however implement one of the following strategies

Export an environment variable as a facter fact.
The easiest way to do that is to include the word facter in the variable.

$export FACTER_FOO=42

In your manifest you then can use the variable foo

if $::foo >= 42

The other way to alter a manifest is to use parameterized classes. A good example of this is the puppetlabs ntp module. ... (more)

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



Asked: 2014-02-15 04:45:42 -0500

Seen: 1,155 times

Last updated: Feb 19 '14