diff --git a/manifests/init.pp b/manifests/init.pp index 3d035ae..23a4ec6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -118,6 +118,15 @@ # Set this to false to disable drafts feature # receive_max_object_size_limit # Maximum allowed Git object size that 'receive-pack' will accept. +# download: +# The allowed download commands and schemes. The data structor for this +# should be a hash with keys and array of values (i.e. {key => [values]}) +# Example: +# download => { +# 'command' => ['checkout', 'cherry_pick', 'pull', 'format_patch'], +# 'scheme' => ['ssh', 'anon_http', 'anon_git'], +# 'archive' => ['tar', 'tbz2', 'tgz', 'txz'], +# }, # TODO: make more gerrit options configurable here # class gerrit( @@ -212,6 +221,7 @@ class gerrit( $receive_max_object_size_limit = '', $cache_diff_timeout = '', $cache_diff_intraline_timeout = '', + $download = {}, ) { include ::httpd @@ -394,6 +404,7 @@ class gerrit( # - $receive_max_object_size_limit # - $cache_diff_timeout # - $cache_diff_intraline_timeout + # - $download file { '/home/gerrit2/review_site/etc/gerrit.config': ensure => present, diff --git a/templates/gerrit.config.erb b/templates/gerrit.config.erb index 841dcc4..df58fd5 100644 --- a/templates/gerrit.config.erb +++ b/templates/gerrit.config.erb @@ -180,6 +180,14 @@ threads = <%= @index_threads %> <% end -%> <% end -%> +<% unless @download.empty? -%> +[download] + <% @download.each do |key, item| -%> + <% item.each do |value| -%> + <%= key %> = <%= value %> + <% end -%> + <% end -%> +<% end -%> [groups] newGroupsVisibleToAll = <%= @new_groups_visible_to_all %> [mimetype "image/*"]