Make bandersnatch::cron class

So that the cronjob may be managed separately.

Change-Id: I56bb3ce2237be1179724f7a2bdcf9d5b04bdecd2
This commit is contained in:
James E. Blair 2016-01-20 13:48:25 -08:00
parent 2940279e8a
commit a88c399ad8
2 changed files with 29 additions and 7 deletions

29
manifests/cron.pp Normal file
View File

@ -0,0 +1,29 @@
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# = Class: bandersnatch::cron
#
# Class to set up bandersnatch cron job.
#
class bandersnatch::cron (
$user = 'root',
) {
cron { 'bandersnatch':
user => $user,
minute => '*/5',
command => 'flock -n /var/run/bandersnatch/mirror.lock timeout -k 2m 30m run-bandersnatch >>/var/log/bandersnatch/mirror.log 2>&1',
environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
}
}

View File

@ -48,11 +48,4 @@ class bandersnatch::mirror (
ensure => present,
content => template('bandersnatch/bandersnatch.conf.erb'),
}
cron { 'bandersnatch':
user => $user,
minute => '*/5',
command => 'flock -n /var/run/bandersnatch/mirror.lock timeout -k 2m 30m run-bandersnatch >>/var/log/bandersnatch/mirror.log 2>&1',
environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
}
}