On Wed, Feb 16, 2011 at 8:18 AM, loki77 <lok...@gmail.com> wrote:
> Hi, I'm looking for a way to have puppet kick off an upgrade of my
> companies software, but only when it's somehow 'told' to.  In cfengine
> you can provide classes from the command line (such as upgrade_code)
> and then have parts of the policy only work if those classes are
> defined.  Is there anyway to do something similar in puppet?  At first
> I thought this was what tags were for, since they can be defined from
> the command line when running puppetd - but it looks like tagged
> resources are always ran, and that when tags are set they are the ONLY
> thing that is run, so that doesn't quite work for what I'm trying to
> do.

You can use implicit tags, all resource in a class should be tagged by
that class name. So if you have a class called foo, you should be able
to use tag foo to apply them.

If you want to perform this conditionally, you can also use
environment variables to set custom facts and use those facts in your
puppet manifests to include classes resource on the fly.

FACTER_install_foo=true; export FACTER_install_foo
FACTER_install_bar=true; export FACTER_install_bar

Bacause "FACTER_" will be stripped off, in your puppet manifest:
if $install_foo {
  include foo
  ...
}

Thanks,

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to