Puppet ignores schedules

786 views
Skip to first unread message

jamido

unread,
Sep 17, 2013, 6:37:36 AM9/17/13
to puppet...@googlegroups.com
Hello, 

the following small code works, but the file /tmp/test will never be created because the schedule is skipped because running on an host.

  1. site.pp:
  2.     test::test_define {hallo:
  3.     }
  4.     include test
  5.  
  6. test/init.pp:
  7. class test {
  8. }
  9. test/test_define.pp
  10. define test::test_define {
  11.   schedule {$name:
  12.     period => daily,
  13.     range => '2-4',
  14.     repeat => 1;
  15.   }
  16.  
  17.   file {'/tmp/test':
  18.     ensure => present,
  19.     schedule => $name;
  20.   }
  21. }
  22.  
  23. Debug Log:
  24.  

  25. Debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
  26. Info: Caching catalog for test2.zdkwh.mlrbw.net
  27. Debug: Creating default schedules
  28. Debug: Loaded state in 0.07 seconds
  29. Info: Applying configuration version '1379405805'
  30. Debug: /Schedule[daily]: Skipping device resources because running on a host
  31. Debug: /Schedule[monthly]: Skipping device resources because running on a host
  32. Debug: /Schedule[hourly]: Skipping device resources because running on a host
  33. Debug: /Schedule[never]: Skipping device resources because running on a host
  34. Debug: /Stage[main]//Node[default]/Test::Test_define[hallo]/File[/tmp/test]: Not scheduled
  35. Debug: /Stage[main]//Node[default]/Test::Test_define[hallo]/Schedule[hallo]: Skipping device resources because running on a host
  36. Debug: /Schedule[weekly]: Skipping device resources because running on a host
  37. Debug: /Schedule[puppet]: Skipping device resources because running on a host
  38. Debug: Finishing transaction 70022790653200
  39. Debug: Storing state
  40. Debug: Stored state in 0.17 seconds
  41. Notice: Finished catalog run in 0.26 seconds
  42. Debug: report supports formats: b64_zlib_yaml pson raw yaml; using pson
    Thanks in advance!

jcbollinger

unread,
Sep 18, 2013, 9:34:08 AM9/18/13
to puppet...@googlegroups.com


On Tuesday, September 17, 2013 5:37:36 AM UTC-5, jamido wrote:
Hello, 

the following small code works, but the file /tmp/test will never be created because the schedule is skipped because running on an host.


You are misinterpreting the output.  File['/tmp/test'] is not applied because the schedule assigned to it does not allow it to be applied during that run.  As a separate issue, the schedule resource itself is not applied to the target node, but that's meaningless because schedules have no physical manifestation on nodes.

You may also be misunderstanding schedules in general.  In particular, they do not schedule a resource to be applied at some later time; instead, they restrict whether resources can be applied during the current run.  The schedule you are using says that each resource it is attached to can be applied only between 02:00 and 04:00 local time, and at most once a day.  For it to be applied at all, the agent must run during the specified time window.  If you are testing outside that window then you should always see the File skipped.


John

jamido

unread,
Oct 1, 2013, 3:58:36 AM10/1/13
to puppet...@googlegroups.com
Hi John, 

sorry for the late response - of course, schedules allow resources to be applied in the window. but after upgrading puppet from 0.25.4 to 3.2.4 some schedules are always ignored and resources gets never applied. It does not happen on all hosts ~250, only on some ~5. 

Jan

jcbollinger

unread,
Oct 1, 2013, 9:06:30 AM10/1/13
to puppet...@googlegroups.com


On Tuesday, October 1, 2013 2:58:36 AM UTC-5, jamido wrote:
Hi John, 

sorry for the late response - of course, schedules allow resources to be applied in the window. but after upgrading puppet from 0.25.4 to 3.2.4 some schedules are always ignored and resources gets never applied. It does not happen on all hosts ~250, only on some ~5. 



That is not what your log fragment depicts.  It shows a schedule being obeyed, preventing the resource to which it is assigned from being applied.  If the schedule were ignored then Puppet would not skip the resource.  If this is happening with the manifest you presented in your initial post then I can think of only a few likely explanations:
  1. You are applying the catalog outside the schedule window (02:00 - 04:00 AM, any day of the week).
  2. You are applying the catalog twice within one schedule window.
  3. Your nodes think you are applying the catalog outside the schedule window, even though you're not.
With respect to (3), time synchronization does not usually present a problem because Puppet's SSL infrastructure prevents nodes from connecting to the master if their clocks are too far off.  However, you might nevertheless have a time discrepancy if some of your nodes are configured with the wrong time zone.


John

Doleschal, Jan (LGL)

unread,
Oct 1, 2013, 9:32:13 AM10/1/13
to puppet...@googlegroups.com

Hi John,

 

Fix it. It was a Problem with the ruby version. Updated ruby from 1.8.7 to ruby 2.0 everything works fine now. I can only repeat myself, scheduled resources never gets applied. The other problem was that the old puppet option ignoreschedule ignored all schedules. With puppet 3.2.4 it is called ignoreschedules. Ignoreschedule must be called with a valid schedule name… .

 

Thanks for helping

 

Jan

 

______________________________________________________________

 

Jan Doleschal

Landesamt für Geoinformation und Landentwicklung

Baden-Württemberg (LGL)

Abteilung 3 - Geodatenzentrum

Ref. 31

Stuttgarter Straße 161

70806 Kornwestheim

 

Tel.:      +49 7154 9598 - 628

Fax:     +7154 9598 -92- 628

E-Mail: Jan.Do...@lgl.bwl.de

http://www.lgl-bw.de

______________________________________________________________

--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/EwAA-WIvC0A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages