Issue #2251 has been updated by Felix Frank.
Nigel Kersten wrote: > user is actually a property of the provider, not a parameter, so we're not > going to be automatically cleaning up crontab entries when you change user. Is that really how that works? I'm still a bit fuzzy on "property vs. parameter". Some readme explained it as "properties are the parts that 'do' things as opposed to merely stating how to do things". So, if the provider deems it necessary to (as puppet will exclaim) to change the user from e.g., 'root' to 'nobody', that sounds like actually doing something, "change" as in "move from A to B". > Think of packages. When you change a resource to install 'foo' rather than > 'bar', we don't uninstall 'bar'. Hmm, that's different. You're changing the name var and start managing a different resource altogether. bar becomes truly unmanaged at this point. > There's definitely a bug here though, which I believe is captured by RI's > update in note 4. Definitely. I will even concede that removing now orphaned (although still "# Puppet name"d) cronjobs may not be the safe thing to do (although users *will* be surprised the orphans linger, trust me). The implication is that cronjobs in different files are separate entities and not to be handled together. So the bug is this: The provider prefetches all cronjobs from disk and falsely links the now orphaned entry to the resource that is now trying to manage a different resource altogether: A job of the same name, but for a different user. I have a fix that will make puppet abandon the orphans. There is a design desicion here though - I believe we could fail the run upon tripping over one such (duplicate) orphan. That way, the user cannot be surprised by the lingerin orphan. This will be easier to discuss once the pull request is up. Stand by. ---------------------------------------- Bug #2251: cron provider doesn't correctly employ user property for resource existence checks. https://projects.puppetlabs.com/issues/2251#change-87294 * Author: Marc Fournier * Status: Accepted * Priority: Normal * Assignee: * Category: cron * Target version: * Affected Puppet version: 0.24.8 * Keywords: cron * Branch: ---------------------------------------- If I change the "user" parameter of a cron{} resource, the previous user will still have the cron listed in his crontab. Assuming the resource name stays the same, I would have expected changing the "user" parameter to be as transparent as changing "hour", "minute", etc. This is a possible workaround, but it may not be desirable in every case: <pre> resource { "cron": purge => true } </pre> -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
