In past versions I could use
cron { ypbot_httpd:
command => ". ~/.bash_profile; ~/ypbot/combust/bin/run_httpd",
user => "ypprod",
special => "reboot",
}
to make a cron entry like
@reboot . ~/.bash_profile; ~/ypbot/combust/bin/run_httpd
in 0.23.0 it broke and now puppet ends up adding the same line over and over again, but with * * * * * instead of "@reboot".
Running puppetd --test says
"err: Could not prefetch "NilClass"rovider crontab: undefined method `each' for nil:NilClass"
notice: //base/standard/prod-server/ypbot_app/Cron[ypbot_httpd]/ensure: created
notice: //base/standard/prod-server/ypbot_app/Cron[ypbot_svscan]/ensure: created
and sure enough, it adds the wrong line again:
# crontab -l -u ypprod
# HEADER This file was autogenerated at Tue Jul 03 12:13:12 -0700 2007 by puppet.
# HEADER While it can still be managed manually, it is definitely notrecommended.
# HEADER Note particularly that the comments starting with 'Puppet Name' should
# HEADER not be deleted, as doing so could cause duplicate cron jobs.
@reboot . ~/.bash_profile; ~/ypbot/bin/svscan/boot &
@reboot . ~/.bash_profile; ~/ypbot/combust/bin/run_httpd
# Puppet Name: ypbot_httpd
* * * * * . ~/.bash_profile; ~/ypbot/combust/bin/run_httpd
# Puppet Name: ypbot_svscan
* * * * * . ~/.bash_profile; ~/ypbot/bin/svscan/boot &
# Puppet Name: ypbot_httpd
* * * * * . ~/.bash_profile; ~/ypbot/combust/bin/run_httpd
# Puppet Name: ypbot_svscan
* * * * * . ~/.bash_profile; ~/ypbot/bin/svscan/boot &
I noticed it's documented to only work on FreeBSD. It does work with vixie-cron too though.