From 54d0db2fea70d45766275a1d5cbd8b2cdd5ecaf0 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 6 Oct 2013 15:26:15 -0400 Subject: [PATCH] Parameterize server OpenStack-isms Make it possible to configure with LDAP or OPENID_SSO. Also, it's possible to not want to need CLAs. Change-Id: Ie6660c819f4078dd4dd5be052e74aaa98c54cab4 --- modules/gerrit/manifests/init.pp | 8 ++++++++ modules/gerrit/templates/gerrit.config.erb | 21 +++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index 1d2ed192a1..c287846fb4 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -86,7 +86,15 @@ class gerrit( $ssh_rsa_pubkey_contents = '', # If left empty puppet will not create file. $ssh_project_rsa_key_contents = '', # If left empty will not create file. $ssh_project_rsa_pubkey_contents = '', # If left empty will not create file. + $gerrit_auth_type = 'OPENID_SSO', + $gerrit_contributor_agreement = true, $openidssourl = 'https://login.launchpad.net/+openid', + $ldap_server = '', + $ldap_account_base = '', + $ldap_username = '', + $ldap_password = '', + $ldap_account_pattern = '', + $ldap_account_email_address = '', $email = '', $database_poollimit = '', $container_heaplimit = '', diff --git a/modules/gerrit/templates/gerrit.config.erb b/modules/gerrit/templates/gerrit.config.erb index ea1b59788a..3f5e4cb58b 100644 --- a/modules/gerrit/templates/gerrit.config.erb +++ b/modules/gerrit/templates/gerrit.config.erb @@ -12,12 +12,25 @@ <% if database_poollimit != "" -%> poolLimit = <%= database_poollimit %> <% end -%> - connectionpool = true + connectionpool = true [auth] - type = OPENID_SSO - openIdSsoUrl = <%= openidssourl %> - cookieSecure = true +<% if gerrit_contributor_agreement -%> contributorAgreements = true +<% end -%> + type = <%= gerrit_auth_type %> + cookieSecure = true +<% if gerrit_auth_type == 'OPENID_SSO' -%> + openIdSsoUrl = <%= openidssourl %> +<% end -%> +<% if gerrit_auth_type == 'LDAP' -%> +[ldap] + server = <%= ldap_server %> + accountBase = <%= ldap_account_base %> + username = <%= ldap_username %> + password = <%= ldap_password %> + accountPattern = <%= ldap_account_pattern %> + accountEmailAddress = <%= ldap_account_email_address %> +<% end %> [sendemail] smtpServer = localhost [container]