Hi, Eric:
On Saturday 24 April 2010 00:47:20 Eric Sorenson wrote:
> rlpowell mentioned this earlier on irc and i find myself in a similar boat
> - I need to express a condition that doesn't fit neatly into the
> class/parameter model and I'm not quite sure how to do it. i'd like to add
> a cron entry IFF a particular file (not managed through puppet) exists.
> Seems like the natural thing would be to do:
>
> cron { "myjob":
> command => "/run/this/script.sh",
> user => roleacct,
> minute => [0,30],
> require => File["/run/this/script.sh"]
> }
>
> file { "/run/this/script.sh":
> ensure => XXX
> }
>
> where XXX is some value that would not cause any changes to the file but
> merely mark the resource as passing or failing depending on the stat().
Since the job execution depends on a resource not already managed by puppet,
why you don't delegate the decision to the cron job itself?
I mean, make sure the cron job is always present and then let it test for the
file as in:
if [ -x /run/this/script.sh ]; then
/run/this/script.sh
fi
Cheers.
--
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.