I would like to have a method that only evaluates a particular class once a day at a specific time. Right now I am running my puppet agent from the cron, but I would like to change it to either run as a daemon, or run more frequently. The barrier with increasing the frequency is that there is one class that takes about 4 minutes to process, and doesn't need to happen very often. I am trying to find some method to only evaluate that particular class once a day from cron.
Is there a simple method for me to set an environment variable (FOO=bar;puppet agent ..
), or add a command line option (puppet agent .. --foo bar
) to the crontab that will become a fact I can use in my manifests to include or not include the class?
class foobar {
if 'bar' == $::foo {
# do the slow stuff
}
}