On Jul 27, 12:02 pm, Sharada <vittal.shar...@gmail.com>
wrote:> Hi,
>
> My initial puppet code for managing cron job was:
>
> cron { ''do-this'':
> command => ''''/user/bin/python
/root/do.py'',
> user => root,
> hour => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17,
> 18, 19, 20, 21, 22, 23],
> minute => 42,
> require => [File[''/home/do.py'']]
> }
>
> Servers connected the controller received this in the root''s cron
tab.
>
> Due to new requirements, I changed ''/usr/bin/python'' to
''/etc/did.sh''
>
> cron { ''do-this'':
> command => ''''/etc/did.sh /root/do.py'',
> user => root,
> hour => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17,
> 18, 19, 20, 21, 22, 23],
> minute => 42,
> require => [File[''/home/do.py'']]
> }
>
> Now, when a new server was made to reference this controller, it received
> the *changed *cron job. The servers connected to the controller before this
> change *still references* ''/usr/bin/python''.
>
> How could I make the ''command'' refresh?
I''m not terribly surprised to hear that a puppet client, when
presented with a manifest that references only the /etc/did.sh crontab
entry, would fail to discern that the old crontab line with /usr/bin/
python was supposed to be managed. My expectation would be that new
and old servers *all* receive the changed job, and that the old
servers retain the original version as well. If the old servers
retain the old line unchanged yet do not receive the new one, however,
then that would constitute a bug.
You should be able to get rid of the obsolete entries by restoring the
original version of the resource and adding "ensure => absent" to
its
properties. Note that your manifests must not contain distinct
resources of the same name and type, so you cannot have both the new
and the old resource without changing one''s name. That points to what
I would have done in the first place, had I been in your shoes:
created the /etc/did.sh version as a *new* Cron resource with a
distinct name, and ensured the original resource absent as described
above. Doing so now may still sort it out.
Good luck.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---