Issue #18627 has been updated by Charlie Sharpsteen. Category set to cron Status changed from Unreviewed to Duplicate
This is a duplicate of symptoms reported in #16809. A fix was merged in [5b06686](https://github.com/puppetlabs/puppet/commit/5b06686) and should be live in 3.2.0. ---------------------------------------- Bug #18627: Builtin 'cron' type removes header line when adding an 'environment' parameter to an existing type defined with 'special'. https://projects.puppetlabs.com/issues/18627#change-89055 * Author: Calvin Walton * Status: Duplicate * Priority: Normal * Assignee: * Category: cron * Target version: * Affected Puppet version: 2.7.20 * Keywords: * Branch: ---------------------------------------- This can be demonstrated by the following mini-manifest (e.g. using puppet apply): <pre>cron { 'test': special => 'weekly', command => '/bin/true', }</pre> which will generate this crontab: <pre># HEADER: This file was autogenerated at Tue Jan 15 15:39:15 -0500 2013 by puppet. # HEADER: While it can still be managed manually, it is definitely not recommended. # HEADER: Note particularly that the comments starting with 'Puppet Name' should # HEADER: not be deleted, as doing so could cause duplicate cron jobs. # Puppet Name: test @weekly /bin/true</pre> If you then modify the resource to be <pre>cron { 'test': special => 'weekly', command => '/bin/true', environment => 'PATH=/usr/bin:/bin', }</pre> then on the next apply, your crontab will look like: <pre># HEADER: This file was autogenerated at Tue Jan 15 15:47:24 -0500 2013 by puppet. # HEADER: While it can still be managed manually, it is definitely not recommended. # HEADER: Note particularly that the comments starting with 'Puppet Name' should # HEADER: not be deleted, as doing so could cause duplicate cron jobs. @weekly /bin/true</pre> In particular, the puppet header line is lost, and the 'environment' data isn't added! On each run, puppet will print a notice stating 'notice: /Stage[main]//Cron[test]/environment: defined 'environment' as 'PATH=/usr/bin:/bin'' but won't actually make any further changes. This does not occur unless the 'special' parameter is used to set the run time. -- 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.
