Hi,
On 11/22/2013 01:48 AM, Martin Langhoff wrote:
> [ Please excuse the perhaps grumpy sounding tone. I am mainly
> surprised/confounded :-) ]
That's cool, I think we should be allowed to be grumpuses (grumpi?) here :-)
> Why all the bikeshedding on using the crontab facility, when
> /etc/cron.d works like a charm?
> If puppet is to have a better way to handle cronjobs, the IMHO clearly
> sane approach would be files under /etc/cron.d . There puppet can
> assume complete control of a given file, control the name of the file,
> etc.
>
> Two easy approaches are evident: install one file per cronjob defined,
> or manage one big file that piles up all the puppet-controlled
> cronjobs for that host. I am sure those options can be expanded and
> refined to handle pretty much any situation we throw at it.
>
> Having built systems over many years -- I cannot imagine a way of
> handling cronjobs through the "crontab" facility that doesn't end up
> being rather brittle eating data occasionally.
The whole cron.d thing is
https://projects.puppetlabs.com/issues/746 and
I have started working on that, but it's far from becoming useful.
We won't be able to deprecate the crontab provider any time soon, I believe.
> I will also note that this is a different case from authorized keys,
> and that taking inspiration from the authorized keys handling code
> might be a bad idea:
Burrowing code is not at all what we were purporting, anyway.
> - authorized_keys isn't giving us a convenient "conf.d" directory structure
>
> - authorized_keys _can_ hold old/stale/redundant entries sanely, one
> rarely prunes it, where old/invalid cronjobs are an immediate source
> of trouble
I disagree about cronjobs implying greater problems. Pruning unknown ssh
keys is likely a security concern for some users.
> - authorized keys can hold duplicate entries without breaking, and
> duplicate entries are safe to prune. Duplicated cronjobs are both a
> valid configuration, and very bad news if not intended.
For parsedfile providers, pruning duplicate entries is pretty hard,
actually (or so I found).
I'm not sure to which you are referring specifically, a) a resource that
appears multiple times but is not managed at all or b) a resource that
duplicates a managed resource.
I don't think that really pertains here. As a matter of fact, the only
type in that module is a2mod and its providers rely on apache2ctl, which
is in spirit much more akin to the crontab provider than a future cron.d
provider.
Purging resources that represent "files in one well known directory"
will be exceedingly easy, I think, because it's trivial to define a
flawless .instances provider method.
> The infra I manage currently has all its cronjobs handled by puppet as
> files under /etc/cron.d. It would naturally be more elegant to be able
> to define the cronjob in a .pp file, and have Puppet handle the file
> itself.
>
> But messing with crontab... options like "purge" that remove data
> blindly ... dragons be there...
Well, that's a question of philosophy, I think.
Personally, I think we should allow users to shoot themselves in their
respective feet to their hearts content, if some of them think the
facility for doing so can be worthwile. In the specific case of purging
lines from crontab files, I can even see potential benefits myself (by
the way, that discussion is more closely related to issue #3220),
although I'm wary of doing it to all possible crontab files on a system
(hence this RFC thread).
When all is said and done, I will gladly bury the crontab provider, then
exhume it, burn it and scatter its ashes throughout the source tree. It
will be awesome.
However, we first need a solid cron.d provider implementation, and even
then, there must be quite a deprecation period, because the old provider
is likely seeing pretty widespread use.
Cheers,
Felix