Bug #1453

removing a cron parameter does not change the object

Added by Martha Greenberg almost 4 years ago. Updated 6 months ago.

Status:Accepted Start date:07/27/2008
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:cron
Target version:2.7.x
Affected Puppet version:0.24.5 Branch:
Keywords:cron
Votes: 2

Description

If you remove a parameter from a cron object, it should change the cron job to have * in that field. However, puppet does not change it unless you specify “*”.

# cat /tmp/1.pp
cron { "test":
  command => "/bin/echo test",
  hour    => "4",
  minute  => "3",
}

# puppet -v /tmp/1.pp
notice: //Cron[test]/ensure: created

# cat /var/spool/cron/crontabs/root
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (- installed on Sun Jul 27 23:45:24 2008)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# HEADER: This file was autogenerated at Sun Jul 27 23:45:24 +0300 2008 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
3 4 * * * /bin/echo test

# cat /tmp/2.pp
cron { "test":
  command => "/bin/echo test",
  minute  => "5",
}

# puppet -v /tmp/2.pp
notice: //Cron[test]/minute: minute changed '3' to '5'

# cat /var/spool/cron/crontabs/root
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (- installed on Sun Jul 27 23:51:11 2008)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# HEADER: This file was autogenerated at Sun Jul 27 23:51:11 +0300 2008 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
5 4 * * * /bin/echo test

Notice that hour is still set to 4, not *!


Related issues

duplicated by Puppet - Feature #5979: Cron resource should update missing time params as '*' Duplicate 01/23/2011
duplicated by Puppet - Bug #1724: removing time from cron doesn't update crontab entry Duplicate 11/01/2008
blocks Puppet - Bug #6990: Rehabilitate cron provider Accepted 04/06/2011

History

Updated by James Turnbull almost 4 years ago

  • Category set to cron
  • Status changed from Unreviewed to Accepted
  • Target version set to 0.25.0
  • Keywords set to cron

Updated by Luke Kanies about 3 years ago

  • Target version changed from 0.25.0 to 2.6.0

I’d like to get this fixed in 0.25, but given its theme, I think it makes more sense to try for 0.26.

Updated by James Turnbull over 2 years ago

  • Target version changed from 2.6.0 to 2.7.x

Updated by Martin Alfke over 1 year ago

This behavior is also present in Version 2.6.2. I have defined hour => “*” as a workaround.

Also available in: Atom PDF