decouple mysql setup from gerrit module
This commit moves the MySQL configuration from the gerrit puppet module into a seperate mysql puppet module. The purpose of this change is to allow us to more easily customise gerrit's mysql configuration for each instance of gerrit that we deploy.. Partial-Bug: 1083101 Change-Id: Ibcc31b3fce8af54229fd4de69a49842ac1c428ae
This commit is contained in:
@@ -67,8 +67,6 @@
|
|||||||
#
|
#
|
||||||
class gerrit(
|
class gerrit(
|
||||||
$war = '',
|
$war = '',
|
||||||
$mysql_password = '',
|
|
||||||
$mysql_root_password = '',
|
|
||||||
$email_private_key = '',
|
$email_private_key = '',
|
||||||
$vhost_name = $::fqdn,
|
$vhost_name = $::fqdn,
|
||||||
$canonicalweburl = "https://${::fqdn}/",
|
$canonicalweburl = "https://${::fqdn}/",
|
||||||
@@ -241,29 +239,6 @@ class gerrit(
|
|||||||
require => File['/home/gerrit2/review_site/etc'],
|
require => File['/home/gerrit2/review_site/etc'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set up MySQL.
|
|
||||||
|
|
||||||
class { 'mysql::server':
|
|
||||||
config_hash => {
|
|
||||||
'root_password' => $mysql_root_password,
|
|
||||||
'default_engine' => 'InnoDB',
|
|
||||||
'bind_address' => '127.0.0.1',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
include mysql::server::account_security
|
|
||||||
|
|
||||||
mysql::db { 'reviewdb':
|
|
||||||
user => 'gerrit2',
|
|
||||||
password => $mysql_password,
|
|
||||||
host => 'localhost',
|
|
||||||
grant => ['all'],
|
|
||||||
charset => 'latin1',
|
|
||||||
require => [
|
|
||||||
Class['mysql::server'],
|
|
||||||
Class['mysql::server::account_security'],
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
# Set up apache.
|
# Set up apache.
|
||||||
|
|
||||||
apache::vhost { $vhost_name:
|
apache::vhost { $vhost_name:
|
||||||
|
|||||||
32
manifests/mysql.pp
Normal file
32
manifests/mysql.pp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# == Class: gerrit::mysql
|
||||||
|
#
|
||||||
|
class gerrit::mysql(
|
||||||
|
$mysql_root_password = '',
|
||||||
|
$database_name = '',
|
||||||
|
$database_user = '',
|
||||||
|
$database_password = '',
|
||||||
|
) {
|
||||||
|
|
||||||
|
class { 'mysql::server':
|
||||||
|
config_hash => {
|
||||||
|
'root_password' => $mysql_root_password,
|
||||||
|
'default_engine' => 'InnoDB',
|
||||||
|
'bind_address' => '127.0.0.1',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
include mysql::server::account_security
|
||||||
|
|
||||||
|
mysql::db { $database_name:
|
||||||
|
user => $database_user,
|
||||||
|
password => $database_password,
|
||||||
|
host => 'localhost',
|
||||||
|
grant => ['all'],
|
||||||
|
charset => 'latin1',
|
||||||
|
require => [
|
||||||
|
Class['mysql::server'],
|
||||||
|
Class['mysql::server::account_security'],
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim:sw=2:ts=2:expandtab:textwidth=79
|
||||||
Reference in New Issue
Block a user