Define local gerrit replication and cronjob only once

We are moving this functionality to puppet module, so in
order to avoid errors, define only these settings here if
needed.

Change-Id: Ie21642c75ec5f3ccd21528c094ff4d34970e5564
This commit is contained in:
Yolanda Robla 2015-08-07 17:38:10 +02:00 committed by yolanda.robla
parent 9e6c0df803
commit fa4d54931e

View File

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