Hi Steve,

with tags you only can execute classes which are enabled anyway.
It is a  way to limit execution on a certain subset of classes.

What else:
you can provide a fact at CLI and react on that specific fact:

FACTER_runnow=true puppet agent —test —tags <class>

Inside your class you will do something like

class foo {
  if $::runnow {
    notify { ‘Only when run now is set’: }
  }
}

On 04 Mar 2015, at 17:12, Steve Harp <[email protected]> wrote:

> Thanks Martin.
> 
> I've tried adding a tag 'testing' to a class and the class deploys regardless 
> of the '--tags testing' being on the puppet agent command line or not.  What 
> am I missing?  I need the class to deploy if and only if specified.
> 
> Thanks...
> 
> On Wednesday, March 4, 2015 at 10:05:34 AM UTC-5, Martin Alfke wrote:
> Hi, 
> On 04 Mar 2015, at 15:57, Steve Harp <[email protected]> wrote: 
> 
> > Hi Guys, 
> > 
> > I'm using Puppet for many configuration items and package deployments.  I 
> > need to be able to only deploy certain packages/classes when the Agent 
> > sends a definable command line option.   
> > 
> > Example: puppet agent --onetime --no-daemonize --verbose 
> > --do_something_special 
> > 
> > I want to be able to execute a class only when the '--do_something_special' 
> > flag is passed. 
> 
> You can use the —tag option to only do what is mentioned in a specific class. 
> 
> e.g. puppet agent —test —tags apache 
> 
> Classes will become tags automatically. 
> Besides this you can use the tag metaparameter on the package resource. 
> 
> hth, 
> 
> Martin 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/2a49081b-bd40-440b-aa86-4937354012de%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/F7829755-16F5-4083-A063-AA816121EEDA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to