Support setting accountPatchReviewDb.url in config
Add accountPatchReviewDb.url as a configurable option to the secure config file (we put it in secure config as the url likely contains a database password in it). This is a new database in Gerrit 2.13 which will default to using an H2 db in review_site/db if a url is not specified. Note that this database must have a different name than the review database (called 'reviewdb' by this module) and if they are the same that database will be dropped and you will have a sad afternoon. Change-Id: Ifc04395f076200a68e6398190a0712c80e5278c6
This commit is contained in:
parent
61f6803f1e
commit
a52cab89f3
|
@ -4,6 +4,12 @@
|
||||||
# The password with which gerrit connects to mysql.
|
# The password with which gerrit connects to mysql.
|
||||||
# mysql_host:
|
# mysql_host:
|
||||||
# The mysql host to which gerrit should connect.
|
# The mysql host to which gerrit should connect.
|
||||||
|
# accountpatchreviewdb_url:
|
||||||
|
# The url to the account patch review database. This database must be
|
||||||
|
# separate from your normal reviewdb as setting them to be the same
|
||||||
|
# will cause the reviewdb to be dropped. Note this puppet module uses
|
||||||
|
# 'reviewdb' for the review database, therefore don't use this name here.
|
||||||
|
# If not set then gerrit will use a default H2 database in review_site/db.
|
||||||
# vhost_name:
|
# vhost_name:
|
||||||
# used in the Apache virtual host, eg., review.example.com
|
# used in the Apache virtual host, eg., review.example.com
|
||||||
# redirect_to_canonicalweburl:
|
# redirect_to_canonicalweburl:
|
||||||
|
@ -175,6 +181,7 @@
|
||||||
#
|
#
|
||||||
class gerrit(
|
class gerrit(
|
||||||
$mysql_password,
|
$mysql_password,
|
||||||
|
$accountpatchreviewdb_url = undef,
|
||||||
$mysql_host = 'localhost',
|
$mysql_host = 'localhost',
|
||||||
$war = '',
|
$war = '',
|
||||||
$email_private_key = '',
|
$email_private_key = '',
|
||||||
|
@ -471,7 +478,8 @@ class gerrit(
|
||||||
# Gerrit sets these permissions in 'init'; don't fight them. If
|
# Gerrit sets these permissions in 'init'; don't fight them. If
|
||||||
# these permissions aren't set correctly, gerrit init will write a
|
# these permissions aren't set correctly, gerrit init will write a
|
||||||
# new secure.config file and lose the mysql password.
|
# new secure.config file and lose the mysql password.
|
||||||
# Template uses $mysql_password, $email_private_key and $token_private_key
|
# Template uses $mysql_password, $email_private_key, $token_private_key,
|
||||||
|
# and accountpatchreviewdb_url.
|
||||||
file { '/home/gerrit2/review_site/etc/secure.config':
|
file { '/home/gerrit2/review_site/etc/secure.config':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
owner => 'gerrit2',
|
owner => 'gerrit2',
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
[database]
|
[database]
|
||||||
password = <%= @mysql_password %>
|
password = <%= @mysql_password %>
|
||||||
|
<% if @accountpatchreviewdb_url -%>
|
||||||
|
[accountPatchReviewDb]
|
||||||
|
url = <%= @accountpatchreviewdb_url %>
|
||||||
|
<% end -%>
|
||||||
[auth]
|
[auth]
|
||||||
registerEmailPrivateKey = <%= @email_private_key %>
|
registerEmailPrivateKey = <%= @email_private_key %>
|
||||||
restTokenPrivateKey = <%= @token_private_key %>
|
restTokenPrivateKey = <%= @token_private_key %>
|
||||||
|
|
Loading…
Reference in New Issue