Issue #22135 has been updated by Charlie Sharpsteen.

Status changed from Unreviewed to Duplicate
Assignee set to Charlie Sharpsteen

Puppet will not enforce any state that is not specified for a resource. For 
example, Puppet won't reset the mode on a file if the mode property is not set 
for the file resource. In the case of cron resources, this behavior applies to 
schedule components as noted in [the 
docs](http://docs.puppetlabs.com/references/3.2.latest/type.html#cron):

> An important note: the Cron type will not reset parameters that are removed 
> from a manifest. For example, removing a minute => 10 parameter will not 
> reset the minute component of the associated cronjob to *. 

Closing as a duplicate of #1453.


----------------------------------------
Bug #22135: Changing Cron in Module doesn't overwrite crontab entry correctly
https://projects.puppetlabs.com/issues/22135#change-96292

* Author: Paul O'Connor
* Status: Duplicate
* Priority: Normal
* Assignee: Charlie Sharpsteen
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
If I create a cron in Puppet like this:

<pre>
  cron { 'Rotate carbon logs':
    command => '/opt/graphite/bin/carbon-logrotate.sh',
    user    => root,
    hour    => 1,
    minute  => 15,
  }
</pre>

it will correctly add an entry in the crontab:

<pre>
15 1 * * * /opt/graphite/bin/carbon-logrotate.sh
</pre>

If I then modify the Cron job to this:

<pre>
  cron { 'Rotate carbon logs':
    command => '/opt/graphite/bin/carbon-logrotate.sh',
    user    => root,
    hour    => '*/1',
  }
</pre>

The cron job becomes this:

<pre>
15 */1 * * * /opt/graphite/bin/carbon-logrotate.sh
</pre>

Notice that the 15 minutes is left in place but is not defined by Puppet.

Using Puppet 3.2.2 on Master, 3.2.3 on Clients.


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to