Issue #18627 has been reported by Calvin Walton.
----------------------------------------
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
Author: Calvin Walton
Status: Unreviewed
Priority: Normal
Assignee:
Category:
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.