Make bandersnatch::cron class
So that the cronjob may be managed separately. Change-Id: I56bb3ce2237be1179724f7a2bdcf9d5b04bdecd2
This commit is contained in:
parent
2940279e8a
commit
a88c399ad8
29
manifests/cron.pp
Normal file
29
manifests/cron.pp
Normal 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',
|
||||
}
|
||||
}
|
@ -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',
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user