Issue #16809 has been updated by Stefan Schulte.

looking more into it, it seems that the `to_line` hook (the one that merges the 
name, found environments, and the cronentry itself) is only implemented for the 
`crontab` record_type but not for the `freebsd_special` record type. To add 
more confusion it does work when the entry is initially created because puppet 
will assume a record_type of `crontab` in that case (#3047).

Having two different `record_types` turns out to be a huge pain when one record 
should switch from a special record to a normal `crontab` record (#3010) so I 
guess the best way is to have one record_type that can handle both entries.
----------------------------------------
Bug #16809: cron resource can destroy other resources
https://projects.puppetlabs.com/issues/16809#change-72832

Author: Stefan Schulte
Status: Unreviewed
Priority: Normal
Assignee: Stefan Schulte
Category: cron
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


I'm currently writing tests for the cronprovider and found an issue when 
removing an entry that has no title.

I have the following crontab:
<pre>
@daily /bin/unnamed
# Puppet Name: named_job
@monthly /bin/named
</pre>

and the following manifest:
<pre>
cron { 'matched_by_command':
  command => '/bin/unnamed',
  special => 'daily',
  ensure  => present,
}
</pre>
If I apply the catalog nothing happens, because the resource can be matched 
again the first cronentry (command and special are the same). If I now switch 
ensure to `absent` I would expect puppet to create the following crontab:
<pre>
# Puppet Name: named_job
@monthly /bin/named
</pre>
however, the actual result:
<pre>
@monthly /bin/named
</pre>
so the cronprovider may destroy the title (and also any environment variables 
between the title and the actual cronentry) of the following cronentrie when 
removing an entry.


-- 
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.

Reply via email to