Keith,

Thanks for that. Did the following:
file { "/etc/cron.d/puppet":
  ensure => file,
  owner => root,
  group => root,
  mode => 0644,
  content => inline_template("<%= scope.function_fqdn_rand([60]) %> * * * * 
root /usr/bin/puppet agent --onetime --no-daemonize --no-splay\n"),
}

Works fine. Cheers,

Jerome Steunenberg


Le jeudi 11 septembre 2014 03:46:14 UTC+2, keith....@gmail.com a écrit :
>
> Jermone;
>
> I am just starting out with puppet, but had a similar issue. i ended up 
> following the hint here and it has worked flawlessly, perhaps it could help 
> you or someone else. scroll to the 2nd half:
>
> http://ryanuber.com/04-29-2010/simple-puppet-cron-management.html
>
>
>
>
>
> On Wednesday, September 10, 2014 9:16:06 AM UTC-4, 
> jerome.st...@clevernetsystems.com wrote:
>>
>> Hello,
>>
>> I've configured a simple cron job:
>>
>> # Cron job for the Puppet agent run (once per hour)
>> cron { "puppet-run":
>>         command => "/usr/bin/puppet agent --onetime --no-daemonize 
>> --no-splay",
>>         minute => fqdn_rand(60),
>> }
>>
>> which is applied successfully and yields:
>>
>> [root@rh65box cron]# crontab -l
>> # HEADER: This file was autogenerated at Wed Sep 10 14:58:08 +0200 2014 
>> by puppet.
>> # HEADER: While it can still be managed manually, it is definitely not 
>> recommended.
>> # HEADER: Note particularly that the comments starting with 'Puppet Name' 
>> should
>> # HEADER: not be deleted, as doing so could cause duplicate cron jobs.
>> # Puppet Name: puppet-run
>> 17 * * * * /usr/bin/puppet agent --onetime --no-daemonize --no-splay
>>
>> That's exactly what I expected but the cron job is never executed.
>> If I issue crontab -e and just save without modifying anything, then the 
>> cron job is executed.
>> It looks like crond doesn't pick up the change made by the puppet agent.
>>
>> Environment is RHEL6.5, puppet 3.6.1.
>>
>> Any ideas ?
>>
>> Thanks,
>>
>> Jerome
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/76760b6c-c554-40f6-ab92-15baac98b7f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to