This has probably been discussed, but I would like an exec to only be
executed if a facter variable is true. Seems there are two ways of
doing this, but I can only get the "if" way to work.
# $lanl_sav_defdate is a custom fact
# make sure the live update file is correct, then force a liveupdate
class forceLiveupdate {
if $lanl_sav_defdate == 'February13,2008'{
# execute the live update command
exec {"liveupdate-now":
command => "[long command omited]",
}
}
}
Is this the "right" way of using a conditional, or should I use an
onlyif? Something like this, which doesn't seem to work for me:
class forceLiveupdate {
# execute the live update command
exec {"liveupdate-now":
command => "[long command omited]",
onlyif => "match $lanl_sav_defdate == 'February13,2008'",
}
}
---
Thanks,
Allan Marcus
505-667-5666
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---