For #1: Puppet is very good at managing cron jobs, in fact there''s a
cron
resource type that makes that very easy:
http://docs.puppetlabs.com/references/latest/type.html#cron
I''m not sure if there''s an easy way to do #2. You could maybe
run a puppet
apply on that manifest out of cron if you have it on all the nodes, but
then you have to deal with getting the code installed on all the hosts,
keeping it up to date, etc.
Honestly, I think you''re making this a lot harder than it needs to be.
Just
run the agent. It shouldn''t cause a big performance issue, especially
when
you only have a few simple modules. The agent runs by default every 30
minutes, maybe that''s really often enough to make your check? You could
set
it to run every 5 minutes too.
You may find as you go on that there are things you''ll want puppet to
do
much more often than once a day. Like managing user accounts, for example
-- you''re maybe not going to want to wait up to a day for a new account
to
show up on the hosts.
Rich
On Fri, Sep 6, 2013 at 10:46 AM, Tony Caffe <anthony@woboinc.com> wrote:
> Hi,
>
> I have puppet running just for a group of 5 servers. I am planning for
> increase and thus why I am starting now with puppet.
>
> I have only one github puppet module, puppet-timezone, as default for all
> nodes and is currently the only module even set up. This is key for our
> scripts to run.
>
> cat site.pp
>
>
>> class base {
>> class { ''timezone'':
>> timezone => ''PST8PDT'',
>> ensure => present,
>> autoupgrade => true,
>> }
>> }
>> node default {
>> include base
>> }
>
>
> Now I want to create 2 groups, one called cacher and other procacher which
> will contain about 4 or so nodes each. They are identical servers in each
> group.
>
> Now I use this on each node install of puppet:
>
> crontab -l -u root
>
>> # Puppet agent check-in to save resources:
>> 0 1 * * * puppet agent --test --onetime
>
>
> I dont need them to check timezone sync all the time and I can utilize
> system resourses by leaving puppet off only to run cron 1 time per day.
> These are small machines and thus dont need puppet agent going all the
time.
>
> Now I want to set up a custom module that will edit a users crontab and
> make sure the two tasks are uncommented out, but this I want to check every
> 5 min.
>
> crontab -u user -l
>
>> # ORDERS
>> */5 * * * * nice /home/user/other-script.php
>> "/home/user/other-script.log" >>
/home/user/other-script.log
>> # BATCH
>> */5 * * * * nice /home/user/script.php
"/home/user/script.log" >>
>> /home/user/script.log
>
>
> So my question/ help needed is 2 parts.
>
> *1st.)* What is the simplest way to create a custom module to check this
> is exactly as is every 5 min, but when I want to it will comment out those
> two scripts and make sure they stay that way till I want them back on?
>
> *2nd.)* (Not as important but would be nice) Is it possible to run this
> module check in crontab -u root every 5 min separate from the default once
> a day check for any other config options/modules I will use in the future,
> including puppet-timezone which is currently only one?
>
> Thanks in advance.
>
> Tony
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscribe@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.