Specify which user is running the mirror
Default user is 'root' to keep backwards compatibility. Change-Id: I8c2347053303e28a55216918c4f8b47cd0c8a7d3
This commit is contained in:
parent
7c85a7d0bc
commit
779e2624f7
|
@ -19,7 +19,9 @@
|
||||||
class bandersnatch::mirror (
|
class bandersnatch::mirror (
|
||||||
$vhost_name,
|
$vhost_name,
|
||||||
$mirror_root = '/srv/static/mirror',
|
$mirror_root = '/srv/static/mirror',
|
||||||
$static_root = '/srv/static'
|
$static_root = '/srv/static',
|
||||||
|
$user = 'root',
|
||||||
|
$group = 'root'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if ! defined(File[$static_root]) {
|
if ! defined(File[$static_root]) {
|
||||||
|
@ -30,15 +32,15 @@ class bandersnatch::mirror (
|
||||||
|
|
||||||
file { $mirror_root:
|
file { $mirror_root:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => 'root',
|
owner => $user,
|
||||||
group => 'root',
|
group => $group,
|
||||||
require => File[$static_root],
|
require => File[$static_root],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${mirror_root}/web":
|
file { "${mirror_root}/web":
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => 'root',
|
owner => $user,
|
||||||
group => 'root',
|
group => $group,
|
||||||
require => File[$mirror_root],
|
require => File[$mirror_root],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +55,8 @@ class bandersnatch::mirror (
|
||||||
|
|
||||||
file { "${mirror_root}/web/robots.txt":
|
file { "${mirror_root}/web/robots.txt":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
owner => 'root',
|
owner => $user,
|
||||||
group => 'root',
|
group => $group,
|
||||||
mode => '0444',
|
mode => '0444',
|
||||||
source => 'puppet:///modules/bandersnatch/robots.txt',
|
source => 'puppet:///modules/bandersnatch/robots.txt',
|
||||||
require => File["${mirror_root}/web"],
|
require => File["${mirror_root}/web"],
|
||||||
|
@ -66,6 +68,7 @@ class bandersnatch::mirror (
|
||||||
}
|
}
|
||||||
|
|
||||||
cron { 'bandersnatch':
|
cron { 'bandersnatch':
|
||||||
|
user => $user,
|
||||||
minute => '*/5',
|
minute => '*/5',
|
||||||
command => 'flock -n /var/run/bandersnatch/mirror.lock timeout -k 2m 30m run-bandersnatch >>/var/log/bandersnatch/mirror.log 2>&1',
|
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',
|
environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
|
||||||
|
|
Loading…
Reference in New Issue