interval specification

15 views
Skip to first unread message

zoniguana

unread,
Aug 6, 2008, 4:05:29 PM8/6/08
to Puppet Users
Is it possible for puppet to run different recipes at different
intervals?

or even different resources at different intervals?

zoniguana

unread,
Aug 6, 2008, 4:21:02 PM8/6/08
to Puppet Users
more specifically, while I can include runinterval to do something
other than the default 30 minutes for all of puppetd, in the
puppet.conf file, can I include something similar in the individual
resources that will specify another frequency?

e.g. if I only want it to check on users/groups once per day, but I
want it to check on config files and make sure they haven't been
changed, every ten minutes, can I include in each of those resources
some parameter that will allow? I didn't see anything in the
metaparameters listed on the site, but, trying to find a way to do
it...

RijilV

unread,
Aug 6, 2008, 4:40:46 PM8/6/08
to puppet...@googlegroups.com
2008/8/6 zoniguana <rjustin...@gmail.com>:

>
> more specifically, while I can include runinterval to do something
> other than the default 30 minutes for all of puppetd, in the
> puppet.conf file, can I include something similar in the individual
> resources that will specify another frequency?
>
> e.g. if I only want it to check on users/groups once per day, but I
> want it to check on config files and make sure they haven't been
> changed, every ten minutes, can I include in each of those resources
> some parameter that will allow? I didn't see anything in the
> metaparameters listed on the site, but, trying to find a way to do
> it...

Take a look at schedules:

http://reductivelabs.com/trac/puppet/wiki/TypeReference#id177

In the case of users/groups, in your site.pp you could setup something like:

User { schedule => once_daily }

and make sure to create the schedule named 'once_daily'

zoniguana

unread,
Aug 6, 2008, 4:56:10 PM8/6/08
to Puppet Users
I spotted that. For my purposes, though, if the goal is not to have
to depend on cron, I'd have to set puppet to default to run every five
minutes, and then set frequencies for everything that I want to run
slower than that. Kind of a pain, if you have a lot of recipes.

currently, I don't, but, as things get more and more involved, and
more and more complicated, I could see this getting to be more of an
issue...

On Aug 6, 4:40 pm, RijilV <rij...@gmail.com> wrote:
> 2008/8/6 zoniguana <rjustinwilli...@gmail.com>:

RijilV

unread,
Aug 6, 2008, 6:10:28 PM8/6/08
to puppet...@googlegroups.com
2008/8/6 zoniguana <rjustin...@gmail.com>:

>
> I spotted that. For my purposes, though, if the goal is not to have
> to depend on cron, I'd have to set puppet to default to run every five
> minutes, and then set frequencies for everything that I want to run
> slower than that. Kind of a pain, if you have a lot of recipes.

It should be mentioned here that puppet is not a cron replacement. If
there is something you want done every 5 mins, it might be better to
use puppet to manage the cron jobs.

That being said, IIRC there is a default schedule of twice every hour
already, so anything that doesn't have an explicit schedule shouldn't
run more than that. you could modify the default schedule like:

Schedule {
period => hourly,
repeat => 4,
}

Anything that doesn't explicitly have another schedule listed will use
the default one.

.r'

zoniguana

unread,
Aug 7, 2008, 12:25:47 PM8/7/08
to Puppet Users
As a matter of interest, if schedule is saying don't run more than 4
times in an hour, it looks like puppet will figure out a default
interval of every 15 minutes. How does that coincide with puppet's
default of running its recipes every half hour? Does it then run the
rest of the recipes every half hour, and that specific resource every
15 minutes?

It certainly seems that way, which would make the answer to my
original question "yes" and make me a very happy camper! :-)

Upon my initial read of Schedule, it seemed to indicate an
exclusivity, such that puppet would run every half hour (or according
to its defined runinterval), and, Schedule only made a difference if
you wanted something to run less frequently.


On Aug 6, 6:10 pm, RijilV <rij...@gmail.com> wrote:
> 2008/8/6 zoniguana <rjustinwilli...@gmail.com>:
>
>
>

David Schmitt

unread,
Aug 8, 2008, 3:54:22 AM8/8/08
to puppet...@googlegroups.com
zoniguana schrieb:

> As a matter of interest, if schedule is saying don't run more than 4
> times in an hour, it looks like puppet will figure out a default
> interval of every 15 minutes. How does that coincide with puppet's
> default of running its recipes every half hour? Does it then run the
> rest of the recipes every half hour, and that specific resource every
> 15 minutes?
>
> It certainly seems that way, which would make the answer to my
> original question "yes" and make me a very happy camper! :-)
>
> Upon my initial read of Schedule, it seemed to indicate an
> exclusivity, such that puppet would run every half hour (or according
> to its defined runinterval), and, Schedule only made a difference if
> you wanted something to run less frequently.


Exactly, that's also my understanding: Schedules are only a upper limit.


Regards, DavidS

zoniguana

unread,
Aug 8, 2008, 6:12:27 AM8/8/08
to Puppet Users
Vielen Dank, David

Fortunately, I think this just became a non-issue for us. I finally
convinced the powers that be to let cron do cron work, so long as
puppet can:
1- make sure that the cron jobs that are supposed to be there, are
2- make sure that crond is running
3- make sure that vixie-cron is running

The concerns having been twofold: we've seen cron spontaneously choke,
and the notion of having to go machine to machine to set appropriate
cron jobs was pretty goofy...

Since it can do all of the above, (and cron, in turn, can run a script
to make sure that puppet is running, with nagios available to monitor
all of the above, as well, try to restart things if they are not
started, and alert us if they cannot be started, there now exists a
much higher level of comfort.

Luke Kanies

unread,
Aug 16, 2008, 5:48:30 PM8/16/08
to puppet...@googlegroups.com

Note that you've specified defaults for schedules here, not actually
modified the default schedule.

And there's actually no default schedule -- by default, every resource
runs in every transaction, and no resource will ever run more often
than Puppet itself runs.

--
It's a small world, but I wouldn't want to paint it.
-- Stephen Wright
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com

Luke Kanies

unread,
Aug 16, 2008, 5:49:17 PM8/16/08
to puppet...@googlegroups.com
On Aug 7, 2008, at 11:25 AM, zoniguana wrote:

> As a matter of interest, if schedule is saying don't run more than 4
> times in an hour, it looks like puppet will figure out a default
> interval of every 15 minutes. How does that coincide with puppet's
> default of running its recipes every half hour? Does it then run the
> rest of the recipes every half hour, and that specific resource every
> 15 minutes?
>
> It certainly seems that way, which would make the answer to my
> original question "yes" and make me a very happy camper! :-)
>
> Upon my initial read of Schedule, it seemed to indicate an
> exclusivity, such that puppet would run every half hour (or according
> to its defined runinterval), and, Schedule only made a difference if
> you wanted something to run less frequently.


Your initial read of Schedule was right -- you can only use it to make
resources run less often, never more.

--
I have lost friends, some by death... others through sheer inability
to cross the street. -- Virginia Woolf

Reply all
Reply to author
Forward
0 new messages