Puppet: Creating Cronjobs via a manifest

Creating cron jobs via Puppet is fairly easy and well explained in available docs. However, I had some trouble adding cron jobs that needed to run at 2 different times a day.

Normal cron behavior is that you just enter a , in between your 2 timestamps and everything is done.

Eg something like this:

Now, when creating a cronjob with Puppet, you’d think that you can just type

in your manifest. The answer is: nope!

This is the error you’ll get:

In the example below you’ll see that you have to use array’s to define your cron schedule:

If you want to schedule this command to run every hour, your can use this however:

Leave a Reply

Your email address will not be published. Required fields are marked *