Issue #2251 has been updated by Casey Brown.

I can verify this issue is still around and causing trouble.
<pre>
[root@foo tmp]# puppet --version
2.7.5

[root@foo tmp]# cat first.pp
cron { 'dupe':
  command => '/bin/true',
  user => 'foo',
  minute => "10",
}

[root@foo tmp]# cat dupe.pp
cron { 'dupe':
  command => '/bin/true',
  user => 'root',
  minute => "10",
}
cron { 'blank':
  command => '/bin/true',
  user => 'foo',
  minute => "10",
}

[root@foo tmp]# crontab -r

[root@foo tmp]# crontab -r -u foo

[root@foo tmp]# puppet apply first.pp
notice: /Stage[main]//Cron[dupe]/ensure: created
notice: Finished catalog run in 1.06 seconds

[root@foo tmp]# crontab -l
no crontab for root

[root@foo tmp]# crontab -l -u foo
# HEADER: This file was autogenerated at Mon Jun 11 16:12:57 -0500 2012 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: dupe
10 * * * * /bin/true

[root@foo tmp]# puppet apply dupe.pp
notice: /Stage[main]//Cron[dupe]/ensure: created
notice: Finished catalog run in 1.06 seconds

[root@foo tmp]# crontab -l -u foo
# HEADER: This file was autogenerated at Mon Jun 11 16:12:57 -0500 2012 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: dupe
10 * * * * /bin/true

[root@foo tmp]# crontab -l
# HEADER: This file was autogenerated at Mon Jun 11 16:13:37 -0500 2012 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: dupe
10 * * * * /bin/true

[root@foo tmp]# puppet apply dupe.pp
notice: /Stage[main]//Cron[blank]/ensure: created
notice: /Stage[main]//Cron[dupe]/user: user changed 'foo' to 'root'
notice: /Stage[main]//Cron[dupe]/target: target changed 'foo' to 'root'
notice: Finished catalog run in 1.07 seconds

[root@foo tmp]# crontab -l
# HEADER: This file was autogenerated at Mon Jun 11 16:14:08 -0500 2012 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: dupe
10 * * * * /bin/true
# Puppet Name: dupe
10 * * * * /bin/true
</pre>
----------------------------------------
Bug #2251: cron provider doesn't correctly employ user property for resource 
existence checks.
https://projects.puppetlabs.com/issues/2251#change-64783

Author: Marc Fournier
Status: Accepted
Priority: Normal
Assignee: 
Category: cron
Target version: 2.7.x
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 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