On Wed, Nov 30, 2011 at 7:41 PM, Dave Alden <[email protected]> wrote:
> Hi,
> Is there some way to have an exec run only if you pass a tag on the command
> line? For example:
>
>
> class fubar {
> exec { 'reboot-system':
> refreshonly => true,
> command => '/usr/bin/reboot',
> subscribe => Class["dummy"]
> }
> }
>
>
> As I would expect, this throws an error the it can't find the dummy class.
> Any suggestions on how I could accomplish this?
You can use facter to conditionally do this. Basically any environment
variable starting with FACTER_ will become a puppet fact.
FACTER_reboot=true puppet agent -t
class fubar {
if $reboot {
exec {
...
}
}
}
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.