scheduler problem?

47 views
Skip to first unread message

Antony Mayi

unread,
Jan 21, 2011, 3:49:33 PM1/21/11
to puppet...@googlegroups.com
Hi,

I am trying to cleanup the puppet reports on the master by puppet itself using the tidy type however want to run it once a day not every 30 minutes. I would expect following code does the trick:

schedule { daily:
  period => daily,
}

tidy { "/var/lib/puppet/reports":
  age => "1w",
  recurse => true,
  matches => "*.yaml",
  schedule => daily
}

however it runs still every 30 minutes and I am getting huge report of tidied logs every half an hour.

what am I doing wrong? how can I change the scheduler for this job to be run only once a day?

thanks Antony.

Nan Liu

unread,
Jan 21, 2011, 6:08:24 PM1/21/11
to puppet...@googlegroups.com

Schedule daily appears to be something that's already defined in
puppet, so I would use a different title.

Do you get a log of the event in your state.yaml? For example:

schedule {
once:
period => daily,
}

exec {
"/bin/date > /tmp/time":
schedule => once,
}

/var/lib/puppet/state/state.yaml:
"Exec[/usr/bin/date > /tmp/time]":
!ruby/sym checked: 2011-01-21 20:23:33.869328 -05:00
!ruby/sym synced: 2011-01-21 20:23:33.870815 -05:00

So in your case, you should have something along the line of:
"Tidy[/var/lib/puppet/reports]":
!ruby/sym checked: 2011-01-21 20:33:17.927550 -05:00

Thanks,

Nan

Antony Mayi

unread,
Jan 24, 2011, 11:29:30 AM1/24/11
to puppet...@googlegroups.com
Hi Nan,

thanks. I have removed the schedule (re)definition but it does still the same - the tidy is called on every run (every 30 minutes). the state.yaml after a typical run has following records:

* puppet log:

Jan 24 10:37:32 puppet puppet-agent[24504]: (/Stage[main]/Puppet::Master/Tidy[/var/lib/puppet/reports]) Tidying File[/var/lib/puppet/reports/puppet/201101171031.yaml]
Jan 24 10:37:32 puppet puppet-agent[24504]: (/Stage[main]/Puppet::Master/Tidy[/var/lib/puppet/reports]) Tidying File[/var/lib/puppet/reports/server1/201101171032.yaml]
Jan 24 10:37:32 puppet puppet-agent[24504]: (/Stage[main]/Puppet::Master/Tidy[/var/lib/puppet/reports]) Tidying File[/var/lib/puppet/reports/server2/201101171035.yaml]
Jan 24 10:37:33 puppet puppet-agent[24504]: (/File[/var/lib/puppet/reports/server1/201101171032.yaml]/ensure) removed
Jan 24 10:37:36 puppet puppet-agent[24504]: (/File[/var/lib/puppet/reports/puppet/201101171031.yaml]/ensure) removed
Jan 24 10:37:36 puppet puppet-agent[24504]: (/File[/var/lib/puppet/reports/server2/201101171035.yaml]/ensure) removed

* state.yaml:

  "Tidy[/var/lib/puppet/reports]": 
    !ruby/sym checked: 2011-01-24 00:49:51.861210 +00:00
  "File[/var/lib/puppet/reports/puppet/201101171031.yaml]": 
    !ruby/sym synced: 2011-01-24 10:37:36.589507 +00:00
    !ruby/sym checked: 2011-01-24 10:37:36.583191 +00:00
  "File[/var/lib/puppet/reports/server1/201101171032.yaml]": 
    !ruby/sym synced: 2011-01-24 10:37:33.482278 +00:00
    !ruby/sym checked: 2011-01-24 10:37:33.476454 +00:00
  "File[/var/lib/puppet/reports/server2/201101171035.yaml]": 
    !ruby/sym synced: 2011-01-24 10:37:36.737558 +00:00
    !ruby/sym checked: 2011-01-24 10:37:36.730387 +00:00

so as I understand it the state.yaml file says the Tidy[/var/lib/puppet/reports] was run at 00:49 so I would expect it won't be called this day again but as the logs show several files are tidied on each run anyway.

what's wrong?

thanks Antony.


From: Nan Liu <n...@puppetlabs.com>
To: puppet...@googlegroups.com
Sent: Fri, 21 January, 2011 18:08:24
Subject: Re: [Puppet Users] scheduler problem?
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


Trevor Vaughan

unread,
Jan 24, 2011, 12:02:28 PM1/24/11
to puppet...@googlegroups.com, Antony Mayi
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Can you try it with a different type, say a sample 'notify' statement?

Tidy appears to have some magic going on at times. I just noticed that
it *appears* to be run before anything else, even in the pre-stage but
that could be a fluke in my setup.

Trevor

> ------------------------------------------------------------------------
> *From:* Nan Liu <n...@puppetlabs.com>
> *To:* puppet...@googlegroups.com
> *Sent:* Fri, 21 January, 2011 18:08:24
> *Subject:* Re: [Puppet Users] scheduler problem?

> <mailto:puppet...@googlegroups.com>.


> To unsubscribe from this group, send email to

> puppet-users...@googlegroups.com
> <mailto:unsub...@googlegroups.com>.


> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>

> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to

> puppet-users...@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

- --
Trevor Vaughan
Vice President, Onyx Point, Inc.
email: tvau...@onyxpoint.com
phone: 410-541-ONYX (6699)
pgp: 0x6C701E94

- -- This account not approved for unencrypted sensitive information --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJNPWpUAAoJECNCGV1OLcypAbwH/3JYreanClJ5kODM9//SYOeJ
oUP0OQXYrmCENWSBRYp7zMNNM3Fl/e+ws5QZMq5dYm1pjFd7ARndv5l5/eGgY9Ma
jSy5EdrqYHetqQgjmSZv39dqdsf+W0QDcVu1cNWZRM7RiHSacj2UMT1y0kfL4juQ
1esvreXILX1cgvBEbgc8xoLv088hoinshxbBAjl4dbgGs9j0Rpj+q6g95mW9vqiL
ZkDFRO9B+rC5eu+MMOm9iwou44o19+r6XBwU8v1HGqFTZHxiCY1P8R8QgGoIDaCG
+qVCWljAY+5VsXv+DGpVYjPETN2EkzWB7qxzQltCrNoF8Y6poJvqB8F2X6kpeWY=
=x0NX
-----END PGP SIGNATURE-----

tvaughan.vcf

Antony Mayi

unread,
Jan 24, 2011, 3:48:14 PM1/24/11
to puppet...@googlegroups.com
good hint - it does work for notify - eg:

 notify { "test": message => "TEST TEST TEST", schedule => daily }
 tidy { "/var/lib/puppet/reports":
    age => "1w",
    recurse => true,
    matches => "*.yaml",
    schedule => daily
 }

the notify is executed only once but tidy still during each run.

is this a bug or a feature? if a bug, is it fixed in some recent version?

thanks, Antony.



From: Trevor Vaughan <tvau...@onyxpoint.com>
To: puppet...@googlegroups.com
Cc: Antony Mayi <anton...@yahoo.com>
Sent: Mon, 24 January, 2011 12:02:28
Subject: Re: [Puppet Users] scheduler problem?

> <mailto:unsub...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to

Peter Meier

unread,
Jan 25, 2011, 1:41:29 PM1/25/11
to puppet...@googlegroups.com
> the notify is executed only once but tidy still during each run.
>
> is this a bug or a feature? if a bug, is it fixed in some recent version?

I would say a bug. Check the bug tracker:
http://projects.puppetlabs.com/projects/puppet/issues for any open or
closed bugs regarding that problem and if you don't find one: Please
file a bug report.

~pete

Antony Mayi

unread,
Jan 26, 2011, 12:39:43 PM1/26/11
to puppet...@googlegroups.com


From: Peter Meier <peter...@immerda.ch>
To: puppet...@googlegroups.com
Sent: Tue, 25 January, 2011 13:41:29

Subject: Re: [Puppet Users] scheduler problem?
--You received this message because you are subscribed to the Google Groups "Puppet Users" group.
Reply all
Reply to author
Forward
0 new messages