diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index 2602216063..f2cb1d51ef 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -66,6 +66,8 @@ # A URL for the remote contact store application # replicate_local: # A boolean enabling local replication for apache acceleration +# replicate_path: +# The path to the local git replica if replicate_local is enabled # gitweb: # A boolean enabling gitweb # cgit: @@ -134,6 +136,7 @@ class gerrit( $enable_melody = false, $melody_session = false, $replicate_local = false, + $replicate_path = '/var/lib/git', $replication = [], $gitweb = true, $cgit = false, @@ -322,6 +325,7 @@ class gerrit( # - $ssl_chain_file # - $canonicalweburl # - $replicate_local + # - $replicate_path # - $contactstore # - $robots_txt_source apache::vhost { $vhost_name: diff --git a/modules/gerrit/templates/gerrit.vhost.erb b/modules/gerrit/templates/gerrit.vhost.erb index 6ebe3c17a8..d99c29d9a0 100644 --- a/modules/gerrit/templates/gerrit.vhost.erb +++ b/modules/gerrit/templates/gerrit.vhost.erb @@ -64,11 +64,11 @@ <% end -%> <% if scope.lookupvar("gerrit::replicate_local") -%> - SetEnv GIT_PROJECT_ROOT /var/lib/git/ + SetEnv GIT_PROJECT_ROOT <%= scope.lookupvar("gerrit::replicate_path") %> SetEnv GIT_HTTP_EXPORT_ALL - AliasMatch ^/p/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/lib/git/$1 - AliasMatch ^/p/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/lib/git/$1 + AliasMatch ^/p/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ <%= scope.lookupvar("gerrit::replicate_path") %>/$1 + AliasMatch ^/p/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ <%= scope.lookupvar("gerrit::replicate_path") %>/$1 ScriptAlias /p/ /usr/lib/git-core/git-http-backend/ <% end -%> diff --git a/modules/openstack_project/manifests/gerrit.pp b/modules/openstack_project/manifests/gerrit.pp index 20804e32ba..1487d0fa3a 100644 --- a/modules/openstack_project/manifests/gerrit.pp +++ b/modules/openstack_project/manifests/gerrit.pp @@ -57,6 +57,7 @@ class openstack_project::gerrit ( $replicate_local = true, $replication = [], $local_git_dir = '/var/lib/git', + $jeepyb_cache_dir = '/opt/lib/jeepyb', $cla_description = 'OpenStack Individual Contributor License Agreement', $cla_file = 'static/cla.html', $cla_id = '2', @@ -178,6 +179,7 @@ class openstack_project::gerrit ( mysql_password => $mysql_password, email_private_key => $email_private_key, replicate_local => $replicate_local, + replicate_path => $local_git_dir, replication => $replication, gitweb => $gitweb, cgit => $cgit, @@ -338,7 +340,7 @@ class openstack_project::gerrit ( weekday => '0', hour => '4', minute => '7', - command => 'find /var/lib/git/ -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \;', + command => "find ${::local_git_dir} -type d -name \"*.git\" -print -exec git --git-dir=\"{}\" repack -afd \;", environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', } } diff --git a/modules/openstack_project/manifests/review_dev.pp b/modules/openstack_project/manifests/review_dev.pp index 4e9cd91518..7fb78d7bdc 100644 --- a/modules/openstack_project/manifests/review_dev.pp +++ b/modules/openstack_project/manifests/review_dev.pp @@ -68,6 +68,7 @@ class openstack_project::review_dev ( web_repo_url => 'https://git.openstack.org/cgit/', swift_username => $swift_username, swift_password => $swift_password, + local_git_dir => '/opt/lib/git', replication => [ { name => 'github', @@ -78,7 +79,7 @@ class openstack_project::review_dev ( }, { name => 'local', - url => 'file:///var/lib/git/', + url => 'file:///opt/lib/git/', replicationDelay => '0', threads => '4', mirror => true, diff --git a/modules/openstack_project/templates/review-dev.projects.ini.erb b/modules/openstack_project/templates/review-dev.projects.ini.erb index 089b1dc197..6a65e94774 100644 --- a/modules/openstack_project/templates/review-dev.projects.ini.erb +++ b/modules/openstack_project/templates/review-dev.projects.ini.erb @@ -2,6 +2,7 @@ homepage=http://openstack.org acl-dir=/home/gerrit2/acls local-git-dir=<%= local_git_dir %> +jeepyb-cache-dir=<%= jeepyb_cache_dir %> gerrit-host=<%= fqdn %> gerrit-user=openstack-dev-project-creator gerrit-key=<%= ssh_project_key %> diff --git a/modules/openstack_project/templates/review.projects.ini.erb b/modules/openstack_project/templates/review.projects.ini.erb index 09a23624d6..6f94e0f8c1 100644 --- a/modules/openstack_project/templates/review.projects.ini.erb +++ b/modules/openstack_project/templates/review.projects.ini.erb @@ -2,6 +2,7 @@ homepage=http://openstack.org acl-dir=/home/gerrit2/acls local-git-dir=<%= local_git_dir %> +jeepyb-cache-dir=<%= jeepyb_cache_dir %> gerrit-host=<%= fqdn %> gerrit-user=openstack-project-creator gerrit-committer=OpenStack Project Creator