Merge "Define local gerrit replication and cronjob only once"

This commit is contained in:
Jenkins 2015-10-21 08:24:55 +00:00 committed by Gerrit Code Review
commit 203a2c0be9

View File

@ -398,18 +398,20 @@ class openstack_project::gerrit (
if ($projects_file != 'UNDEF') { if ($projects_file != 'UNDEF') {
if ($replicate_local) { if ($replicate_local) {
file { $local_git_dir: if (!defined(File[$local_git_dir])) {
ensure => directory, file { $local_git_dir:
owner => 'gerrit2', ensure => directory,
require => Class['::gerrit'], owner => 'gerrit2',
} require => Class['::gerrit'],
cron { 'mirror_repack': }
user => 'gerrit2', cron { 'mirror_repack':
weekday => '0', user => 'gerrit2',
hour => '4', weekday => '0',
minute => '7', hour => '4',
command => "find ${local_git_dir} -type d -name \"*.git\" -print -exec git --git-dir=\"{}\" repack -afd \\;", minute => '7',
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', command => "find ${local_git_dir} -type d -name \"*.git\" -print -exec git --git-dir=\"{}\" repack -afd \\;",
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
}
} }
} }