Feature #746
Create Cron provider for /etc/cron.d entries
| Status: | Accepted | Start date: | ||
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | cron | |||
| Target version: | 3.X | |||
| Affected Puppet version: | 0.22.1 | Branch: | ||
| Keywords: | ||||
| Votes: | 2 |
Description
Provide support for managing cron job through /etc/crontab.
Former bug text: Under darwin, the root user is usually disabled, thus it’s crontab does not work. As a work around it is possible to create those jobs in /etc/crontab I did not look into the cron provider, but I guess the change to the code is minimal. thanks.
Related issues
History
Updated by Luke Kanies almost 5 years ago
You would need to create a new provider for managing /etc/crontab. It might seem minimal, but managing cron jobs has turned out to be one of the most complicated types in Puppet.
Updated by Udo Waechter almost 5 years ago
I think I have to object to the statement above. The only difference in /etc/crontab to the user’s crontabs is that in the first case we have to specify the user under which a certain task is run. Since puppet generates the crontab entry anyway, the change is not very huge. The user (which is given anyway) has to be added at the right position in the crontab line.
I do not think it is a good idea to start splitting up the cron provider into 2. This would introduce a lot mor complexity than is actually desired, I guess.
One issue remains, though: we do not want do delete or overwrite already existing crontab entries. Why not user the “bracket editor” for this?
I still did not have the rime to look into this provider. I found a workaround, so maybe I simply do not understand the complexity of this provider.
Updated by Luke Kanies over 4 years ago
- Status changed from 1 to Closed
- 7 set to invalid
Well, the file format is different, and you can’t use the ‘crontab’ command to edit /etc/crontab, so the behaviour is pretty different. The formats are similar but not the same.
This ticket is both an enhancement request and a bug report that can be fixed pretty easily by enabling the root user, so in either case the ticket isn’t appropriate. Feel free to open an enhancement request for /etc/crontab support.
Updated by James Turnbull almost 4 years ago
- Subject changed from disabled root user's crontab does not work under darwin to Provide support for /etc/crontab files as a type
- Status changed from Closed to Unreviewed
- Target version deleted (
4)
Updated by AJ Christensen almost 4 years ago
- Category set to cron
- Status changed from Unreviewed to Accepted
- Assignee changed from Luke Kanies to Puppet Community
- Target version set to 4
This would require munging of the existing crontab provider, or a munged copy of it to support the different format for /etc/crontab. If someone is interested in getting this functionality, please supply code+tests. Thanks!
Updated by Marc Fournier about 3 years ago
- Affected Puppet version set to 0.22.1
It should now/soon be possible to do this using augeas. A lens for cron files has been recently commited to augeas’s repository: http://git.fedoraproject.org/git/?p=augeas.git;a=commit;h=f611b12cb74496422b787e002b922334f982c882
It will probably be part of augeas’s next release.
Updated by James Turnbull almost 3 years ago
- Assignee deleted (
Puppet Community)
Updated by Nigel Kersten about 1 year ago
- Subject changed from Provide support for /etc/crontab files as a type to Create Cron provider for /etc/cron.d entries
- Target version changed from 4 to 2.7.x
Augeas can be used to manage /etc/crontab, otherwise we’re going to target this issue at providing /etc/cron.d/ cron entries, as it’s a significantly easier problem, and we have Augeas functionality for the main file.
Updated by Nigel Kersten about 1 year ago
- Status changed from Accepted to Duplicate
Updated by Nigel Kersten about 1 year ago
- Status changed from Duplicate to Accepted
Updated by Nigel Kersten about 1 year ago
- Priority changed from Normal to High
To clarify, we’re going to start developing this /etc/cron.d provider as a module during the life of Statler, and merge it into Telly on release.
This is high priority due to the number of issues with the ParsedFile crontab provider.
Updated by Nigel Kersten about 1 year ago
- Target version changed from 2.7.x to 3.X
Updated by Alex Jurkiewicz 4 months ago
Is anyone actively working on this yet? I am interested in doing the work if not.
Updated by James Turnbull 4 months ago
Alex – we’d love to see someone produce this feature. Please remember it’d be great if you could include tests too.
Updated by Daniel Pittman 4 months ago
Alex Jurkiewicz wrote:
Is anyone actively working on this yet? I am interested in doing the work if not.
No. This is something we would love to do, but it hasn’t hit sufficient priority yet. :/
There are several implementations out there using, eg, defines to implement this, if you want examples, but it shouldn’t be too terrible to get done.
If you run into trouble, or whatever, feel free to call on my on IRC, email, or here for assistance.
Updated by nathan halsey 4 months ago
Alex, do you still want to work this ticket? It is still open for you.
Updated by Alex Jurkiewicz 4 months ago
Sorry, I’m not going to be doing this. I’ve spent some time working on it but the type<->provider interface is very strange and I think doing this properly requires updates on the type side as well. That’s many more hours of work than I was hoping. We’re sticking to
file { “/etc/cron.d/blah”: … } for now.