Merge "Specify which user is running the mirror"

This commit is contained in:
Jenkins 2015-08-14 20:41:36 +00:00 committed by Gerrit Code Review
commit 9f6999c79d
1 changed files with 10 additions and 7 deletions

View File

@ -19,7 +19,9 @@
class bandersnatch::mirror (
$vhost_name,
$mirror_root = '/srv/static/mirror',
$static_root = '/srv/static'
$static_root = '/srv/static',
$user = 'root',
$group = 'root'
) {
if ! defined(File[$static_root]) {
@ -30,15 +32,15 @@ class bandersnatch::mirror (
file { $mirror_root:
ensure => directory,
owner => 'root',
group => 'root',
owner => $user,
group => $group,
require => File[$static_root],
}
file { "${mirror_root}/web":
ensure => directory,
owner => 'root',
group => 'root',
owner => $user,
group => $group,
require => File[$mirror_root],
}
@ -53,8 +55,8 @@ class bandersnatch::mirror (
file { "${mirror_root}/web/robots.txt":
ensure => present,
owner => 'root',
group => 'root',
owner => $user,
group => $group,
mode => '0444',
source => 'puppet:///modules/bandersnatch/robots.txt',
require => File["${mirror_root}/web"],
@ -66,6 +68,7 @@ class bandersnatch::mirror (
}
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',