[Puppet Users] Re: How to pass parameter from puppet-client ?

Eric Heydrick
Wed, 28 May 2008 03:40:10 -0000

On Tue, 27 May 2008, tung dang wrote:

> Hi all,
> Firstly, thank for your answer
> As i know tags is used for resources, that means all the tags has to define
in the manifests before using
> Can puppet-client pass the variable parameter to puppetmaster ?
> Have anyone ever done it?
> Can i write a program, module to capture tags, that doesn''t exist
in the manifest ?

Puppet will make variables for environment variables named FACTER_. So if
you wanted a variable called $foo in your manifest run puppetd like
"FACTER_foo=bar puppetd ...".  You can tie that to tags so that
defining a
variable in the environment defines a tag:

if $foo {
  tag(dosomething)
}

if tagged(dosomething) {
  dosomething
}

-Eric