diff --git a/manifests/site.pp b/manifests/site.pp index 3b50fa9ff6..a0f927b504 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -16,8 +16,8 @@ node 'review.openstack.org' { github_oauth_token => hiera('gerrit_github_token'), github_project_username => hiera('github_project_username'), github_project_password => hiera('github_project_password'), + mysql_host => 'localhost', mysql_password => hiera('gerrit_mysql_password'), - mysql_root_password => hiera('gerrit_mysql_root_password'), email_private_key => hiera('gerrit_email_private_key'), gerritbot_password => hiera('gerrit_gerritbot_password'), ssl_cert_file_contents => hiera('gerrit_ssl_cert_file_contents'), @@ -49,8 +49,8 @@ node 'review-dev.openstack.org' { github_oauth_token => hiera('gerrit_dev_github_token'), github_project_username => hiera('github_dev_project_username'), github_project_password => hiera('github_dev_project_password'), + mysql_host => hiera('gerrit_dev_mysql_host'), mysql_password => hiera('gerrit_dev_mysql_password'), - mysql_root_password => hiera('gerrit_dev_mysql_root_password'), email_private_key => hiera('gerrit_dev_email_private_key'), contactstore_appsec => hiera('gerrit_dev_contactstore_appsec'), contactstore_pubkey => hiera('gerrit_dev_contactstore_pubkey'), diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index b79ddd7137..ff16c665b8 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -1,5 +1,7 @@ # Install and maintain Gerrit Code Review. # params: +# mysql_host: +# The mysql host to which gerrit should connect. # mysql_password: # The password with which gerrit connects to mysql. # vhost_name: @@ -76,6 +78,7 @@ # TODO: make more gerrit options configurable here # class gerrit( + $mysql_host = 'localhost', $mysql_password, $war = '', $email_private_key = '', @@ -252,6 +255,7 @@ class gerrit( # Gerrit sets these permissions in 'init'; don't fight them. # Template uses: + # - $mysql_host # - $canonicalweburl # - $database_poollimit # - $gerrit_contributor_agreement diff --git a/modules/gerrit/templates/gerrit.config.erb b/modules/gerrit/templates/gerrit.config.erb index 01f128ba32..462becb672 100644 --- a/modules/gerrit/templates/gerrit.config.erb +++ b/modules/gerrit/templates/gerrit.config.erb @@ -6,7 +6,7 @@ canonicalWebUrl = <%= canonicalweburl %> [database] type = MYSQL - hostname = localhost + hostname = <%= mysql_host %> database = reviewdb username = gerrit2 <% if database_poollimit != "" -%> diff --git a/modules/openstack_project/manifests/gerrit.pp b/modules/openstack_project/manifests/gerrit.pp index 42b827a722..20804e32ba 100644 --- a/modules/openstack_project/manifests/gerrit.pp +++ b/modules/openstack_project/manifests/gerrit.pp @@ -4,6 +4,7 @@ # up for launchpad single sign on and bug/blueprint links class openstack_project::gerrit ( + $mysql_host, $mysql_password, $vhost_name = $::fqdn, $canonicalweburl = "https://${::fqdn}/", diff --git a/modules/openstack_project/manifests/review.pp b/modules/openstack_project/manifests/review.pp index 709317bba1..7216b617f6 100644 --- a/modules/openstack_project/manifests/review.pp +++ b/modules/openstack_project/manifests/review.pp @@ -38,8 +38,8 @@ class openstack_project::review ( $github_project_password = '', # Create arbitrary values and put here, puppet will use during # provisioning. + $mysql_host = '', $mysql_password = '', - $mysql_root_password = '', $email_private_key = '', # Register an IRC bot and supply it's password here. $gerritbot_password = '', @@ -124,6 +124,7 @@ class openstack_project::review ( github_project_username => $github_project_username, github_project_password => $github_project_password, trivial_rebase_role_id => 'trivial-rebase@review.openstack.org', + mysql_host => $mysql_host, mysql_password => $mysql_password, email_private_key => $email_private_key, sysadmins => $sysadmins, diff --git a/modules/openstack_project/manifests/review_dev.pp b/modules/openstack_project/manifests/review_dev.pp index 5170bbdcfe..4e9cd91518 100644 --- a/modules/openstack_project/manifests/review_dev.pp +++ b/modules/openstack_project/manifests/review_dev.pp @@ -4,8 +4,8 @@ class openstack_project::review_dev ( $github_oauth_token = '', $github_project_username = '', $github_project_password = '', + $mysql_host = '', $mysql_password = '', - $mysql_root_password = '', $email_private_key = '', $contactstore = true, $contactstore_appsec = '', @@ -28,14 +28,6 @@ class openstack_project::review_dev ( User::Virtual::Localuser['zaro'], ) - # Setup MySQL - class { 'gerrit::mysql': - mysql_root_password => $mysql_root_password, - database_name => 'reviewdb', - database_user => 'gerrit2', - database_password => $mysql_password, - } - class { 'openstack_project::gerrit': vhost_name => 'review-dev.openstack.org', canonicalweburl => 'https://review-dev.openstack.org/', @@ -67,6 +59,7 @@ class openstack_project::review_dev ( github_oauth_token => $github_oauth_token, github_project_username => $github_project_username, github_project_password => $github_project_password, + mysql_host => $mysql_host, mysql_password => $mysql_password, email_private_key => $email_private_key, sysadmins => $sysadmins,