Specify which user is running the mirror

Default user is 'root' to keep backwards compatibility.

Change-Id: I8c2347053303e28a55216918c4f8b47cd0c8a7d3
This commit is contained in:
Nikki Heald 2015-07-16 09:55:07 +01:00
parent 7c85a7d0bc
commit 779e2624f7
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',