Create cron jobs?

Hi

We are running foreman 3.3.0 with latest puppet 7,

Whats the correct way to deploy cronjobs to new vms? cant seem to find a module thats able to do it per host group as i was in the older versions.

What do other people do ? or do you know what module you can use for creating them.

I’m not sure what you refer to in the older versions, perhaps cron module in earlier versions of puppet? However what I typically do with puppet is, I write a module which uses file resource that uses template as a content, that creates an entry in /etc/cron.d/. I found the cron module limiting, e.g. when I needed to reconfigure the crontab later or delete the record entirely.

Hi Sir,

if i want to deploy a cronjob to a group of servers - i seem to be lacking the option to do that

in the earlier version we had a wrapper to deploy cron jobs based on various tasks - this seem gone now in the newer version - if i centrally wanted to make sure i could control the creation of cronjobs.

I am sorry, I still don’t fully understand how you did that earlier. Could you describe step by step how you achieved that with the older version of Foreman? That would help me to understand what we’re talking about.

Today, Foreman allows you to configure cron jobs via multiple ways for the entire groups. You can pick from Puppet, Ansible, Salt or simply using Remote Execution. For all of the above, you need a plugin. Perhaps the recent change you mean is the fact we extracted the Puppet functionality to the foreman_puppet plugin. If you plan to use Puppet functionality in future, make sure you have that still installed.

Hi Marek

Prior we had a wrapper for creating cron jobs on the hosts (matched to a host group) so if i wantd to creat 5 cron jobs on a hostgroup it was easy to do.

now it seems impossible? if you wanna utilize the plugins i found only puppet-cron and cron_core but that seems only for handling the cron service on the machines not creating jobs.

Hello,

sorry I’m still not sure how the wrapper worked, what the wrapper was and what it wrapped. From what you’re saying it had probably something to do with the Puppet but I don’t see how some recent Foreman changes could have affect that. This forum is for Foreman issues, not for Puppet changes.