diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index 6c3b9e15eb..50760ba965 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -64,6 +64,10 @@ # A boolean enabling local replication for apache acceleration # gitweb: # A boolean enabling gitweb +# cgit: +# A boolean enabling cgit +# web_repo_url: +# Url for setting the location of an external git browser # testmode: # Set this to true to disable cron jobs and replication, # which can interfere with testing. @@ -122,6 +126,8 @@ class gerrit( $replication = [], $replication_targets = [], $gitweb = true, + $cgit = false, + $web_repo_url = '', $testmode = false ) { include apache diff --git a/modules/gerrit/templates/gerrit.config.erb b/modules/gerrit/templates/gerrit.config.erb index 8ed0a19ddc..69e2cf927c 100644 --- a/modules/gerrit/templates/gerrit.config.erb +++ b/modules/gerrit/templates/gerrit.config.erb @@ -97,9 +97,16 @@ [melody] monitoring = <%= enable_melody %> session = <%= melody_session %> -<% if gitweb -%> +<% if gitweb or cgit -%> [gitweb] +<% if gitweb -%> revision = "?p=${project}.git;a=commitdiff;h=${commit}" +<% else -%> + type = cgit +<% end -%> +<% if web_repo_url -%> + url = "<%= web_repo_url %>" +<% end -%> <% end -%> <% if contactstore == true -%> [contactstore] diff --git a/modules/openstack_project/manifests/gerrit.pp b/modules/openstack_project/manifests/gerrit.pp index 922bf4532c..5778a6a8ec 100644 --- a/modules/openstack_project/manifests/gerrit.pp +++ b/modules/openstack_project/manifests/gerrit.pp @@ -58,6 +58,9 @@ class openstack_project::gerrit ( $sysadmins = [], $swift_username = '', $swift_password = '', + $gitweb = true, + $cgit = false, + $web_repo_url = '', ) { class { 'openstack_project::server': iptables_public_tcp_ports => [80, 443, 29418], @@ -156,6 +159,9 @@ class openstack_project::gerrit ( email_private_key => $email_private_key, replicate_local => $replicate_local, replication => $replication, + gitweb => $gitweb, + cgit => $cgit, + web_repo_url => $web_repo_url, testmode => $testmode, require => Class[openstack_project::server], } diff --git a/modules/openstack_project/manifests/review_dev.pp b/modules/openstack_project/manifests/review_dev.pp index ab4fef8a08..fa47cd0d52 100644 --- a/modules/openstack_project/manifests/review_dev.pp +++ b/modules/openstack_project/manifests/review_dev.pp @@ -64,6 +64,9 @@ class openstack_project::review_dev ( 'trivial-rebase@review-dev.openstack.org', email_private_key => $email_private_key, sysadmins => $sysadmins, + gitweb => false, + cgit => true, + web_repo_url => 'https://git.openstack.org/cgit', swift_username => $swift_username, swift_password => $swift_password, replication => [