2013-12-16 15:49:44 +11:00
|
|
|
# == Class: nova::db::mysql
|
2012-04-23 17:15:26 -07:00
|
|
|
#
|
|
|
|
# Class that configures mysql for nova
|
|
|
|
#
|
2013-12-16 15:49:44 +11:00
|
|
|
# === Parameters:
|
|
|
|
#
|
|
|
|
# [*password*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Required) Password to use for the nova user
|
2013-12-16 15:49:44 +11:00
|
|
|
#
|
|
|
|
# [*dbname*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Optional) The name of the database
|
2013-12-16 15:49:44 +11:00
|
|
|
# Defaults to 'nova'
|
|
|
|
#
|
|
|
|
# [*user*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Optional) The mysql user to create
|
2013-12-16 15:49:44 +11:00
|
|
|
# Defaults to 'nova'
|
|
|
|
#
|
|
|
|
# [*host*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Optional) The IP address of the mysql server
|
2013-12-16 15:49:44 +11:00
|
|
|
# Defaults to '127.0.0.1'
|
|
|
|
#
|
|
|
|
# [*charset*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Optional) The charset to use for the nova database
|
2014-05-23 15:05:02 -04:00
|
|
|
# Defaults to 'utf8'
|
2013-12-16 15:49:44 +11:00
|
|
|
#
|
2014-02-18 13:03:06 +11:00
|
|
|
# [*collate*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Optional) The collate to use for the nova database
|
2015-04-21 13:12:13 -04:00
|
|
|
# Defaults to 'utf8_general_ci'
|
2014-02-18 13:03:06 +11:00
|
|
|
#
|
2013-12-16 15:49:44 +11:00
|
|
|
# [*allowed_hosts*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Optional) Additional hosts that are allowed to access this DB
|
2013-12-16 15:49:44 +11:00
|
|
|
# Defaults to undef
|
|
|
|
#
|
2017-01-18 21:26:43 +00:00
|
|
|
# [*setup_cell0*]
|
2018-06-15 15:07:37 +08:00
|
|
|
# (Optional) Setup a cell0 for the cell_v2 functionality. This option will
|
2017-01-18 21:26:43 +00:00
|
|
|
# be set to true by default in Ocata when the cell v2 setup is mandatory.
|
2018-11-19 13:54:54 +01:00
|
|
|
# Defaults to true
|
2017-01-18 21:26:43 +00:00
|
|
|
#
|
2012-04-23 17:15:26 -07:00
|
|
|
class nova::db::mysql(
|
2011-05-26 18:48:23 -07:00
|
|
|
$password,
|
2013-05-08 18:09:29 -04:00
|
|
|
$dbname = 'nova',
|
|
|
|
$user = 'nova',
|
|
|
|
$host = '127.0.0.1',
|
2014-05-23 15:05:02 -04:00
|
|
|
$charset = 'utf8',
|
2015-04-21 13:12:13 -04:00
|
|
|
$collate = 'utf8_general_ci',
|
2011-06-17 11:25:10 -07:00
|
|
|
$allowed_hosts = undef,
|
2017-01-18 21:26:43 +00:00
|
|
|
$setup_cell0 = true,
|
2011-05-26 12:19:52 -07:00
|
|
|
) {
|
2011-05-31 17:57:19 -07:00
|
|
|
|
2019-12-08 23:13:08 +01:00
|
|
|
include nova::deps
|
2015-11-16 02:55:39 +00:00
|
|
|
|
2014-07-10 15:49:41 -07:00
|
|
|
::openstacklib::db::mysql { 'nova':
|
|
|
|
user => $user,
|
2020-05-17 09:21:48 +09:00
|
|
|
password => $password,
|
2014-07-10 15:49:41 -07:00
|
|
|
dbname => $dbname,
|
|
|
|
host => $host,
|
|
|
|
charset => $charset,
|
|
|
|
collate => $collate,
|
|
|
|
allowed_hosts => $allowed_hosts,
|
2013-07-30 18:40:19 +08:00
|
|
|
}
|
|
|
|
|
2018-04-11 15:56:06 +02:00
|
|
|
if $setup_cell0 {
|
2017-01-18 21:26:43 +00:00
|
|
|
# need for cell_v2
|
|
|
|
::openstacklib::db::mysql { 'nova_cell0':
|
|
|
|
user => $user,
|
2020-05-17 09:21:48 +09:00
|
|
|
password => $password,
|
2017-01-18 21:26:43 +00:00
|
|
|
dbname => "${dbname}_cell0",
|
|
|
|
host => $host,
|
|
|
|
charset => $charset,
|
|
|
|
collate => $collate,
|
|
|
|
allowed_hosts => $allowed_hosts,
|
|
|
|
create_user => false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-16 02:55:39 +00:00
|
|
|
Anchor['nova::db::begin']
|
|
|
|
~> Class['nova::db::mysql']
|
|
|
|
~> Anchor['nova::db::end']
|
2011-05-26 12:19:52 -07:00
|
|
|
}
|