Ian,
Try this:
define crontab($host = $hostname) {
$path = "/tmp/$name.$host.cron"
remotefile { $path:
source => "ops/cron/$host/$name.cron",
}
exec { "crontab-$name":
command => "crontab -u $name $path",
subscribe => File[$path],
refreshonly => true
}
}
On 1/29/07, Ian Burrell <ianburrell@gmail.com>
wrote:>
> I am writing a definition that installs a crontab. I would like it to
> run the command only when the downloaded file changes. I am using
> "subscribe" but it doesn''t seem to do the job. The exec
command is
> run every time.
>
> define crontab($host = $hostname) {
> $path = "/tmp/$name.$host.cron"
> remotefile { $path:
> source => "ops/cron/$host/$name.cron",
> }
> exec { "crontab-$name":
> command => "crontab -u $name $path",
> subscribe => File[$path],
> }
> }
>
> - Ian
> _______________________________________________
> Puppet-users mailing list
> Puppet-users@madstop.com
> https://mail.madstop.com/mailman/listinfo/puppet-users
>
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users