Using schedules with resources

Using a schedule resource, you can control when other resources get applied. For example, the built-in daily schedule does what you'd expect: if you specify a resource, such as the following, then it'll be applied once a day:

exec { "/usr/bin/apt-get update":
    schedule => daily,
     }

The slightly tricky thing about schedule is that it doesn't guarantee that the resource will be applied once a day. It's just a limit: the resource won't be applied more than once a day. When and whether the resource is applied at all will depend on when and whether Puppet runs.

That being so, schedule is best used to restrict other resources, for example, you might want to make sure that apt-get update hasn't run more than once an hour, or ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.