The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #1411

puppet command line options for running recipes

Added by Lawrence Ludwig almost 6 years ago. Updated almost 4 years ago.

Status:RejectedStart date:07/10/2008
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Affected Puppet version:0.24.4 Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

I propose that puppet (not puppetd or puppetmaster) allows command line options to set variables within the recipe. IE.

% puppet --var1=foo --var2=bar

Which then is accessible within the recipe:


case $var1 {
    "foo": ....
}

package { "$var2":
    ensure => installed,
}

Any reserved options (ie —help —debug, etc.) cannot be used.

History

#1 Updated by Lawrence Ludwig almost 6 years ago

The use case for this is puppet can be used to replace shell scripts. People who want to use puppet, yet don’t want to setup all of the options needed to use puppet features (ie puppetd & puppetmaster)

Passing command line options give some flexibility to recipes that puppetd/puppetmaster can set might be able to set in the ‘node’ which couldn’t be used with just puppet.

#2 Updated by Luke Kanies almost 6 years ago

  • Status changed from Unreviewed to Rejected

You can already do this using facter:

facter_var1=foo facter_var2=bar puppet ~/bin/test.pp

#3 Updated by Lawrence Ludwig almost 6 years ago

luke wrote:

You can already do this using facter: […]

Yea but I wouldn’t call this “user friendly”. I mean I can create a shell script to pass to puppet, but the method to do this seems kinda hackish to me. I consider this IMHO more of a work around to the feature request. Are all variables created using facter before puppet runs? I assume no.

#4 Updated by Lawrence Ludwig almost 6 years ago

luke wrote:

You can already do this using facter: […]

Tried every way to sunday to get this to work via a bash shell, did not work.

#5 Updated by Lawrence Ludwig almost 6 years ago

lludwig wrote:

luke wrote:

You can already do this using facter: […]

Tried every way to sunday to get this to work via a bash shell, did not work.

scratch that I figured it out.

Also available in: Atom PDF