Files
puppet-nova/manifests/db/mysql_api.pp
Alex Schultz 055f91446f Enable cell_v2 setup by default
In Ocata, nova has made the cell_v2 setup mandatory as part of the
upgrade process in I72fb724dc13e1a5f4e97c58915b538ba761c582d. This
change makes the cell_v2 setup part of the default install for Ocata as
this feature will be required for some parts of nova in Ocata.

Depends-On: I693239ff5026f58a65eb6278b1a8fcb97af4f561
Depends-On: I08efa36f5f62ae406ab20e8da77c01fbf3d9b11f
Change-Id: I7839e3c8bfdec96b0d372e7a9d3511289e8004b9
Related-Bug: #1649341
2016-12-23 03:57:42 +00:00

79 lines
1.8 KiB
Puppet

# == Class: nova::db::mysql_api
#
# Class that configures mysql for the nova_api database.
#
# === Parameters:
#
# [*password*]
# Password to use for the nova user
#
# [*dbname*]
# (optional) The name of the database
# Defaults to 'nova_api'
#
# [*user*]
# (optional) The mysql user to create
# Defaults to 'nova_api'
#
# [*host*]
# (optional) The IP address of the mysql server
# Defaults to '127.0.0.1'
#
# [*charset*]
# (optional) The charset to use for the nova database
# Defaults to 'utf8'
#
# [*collate*]
# (optional) The collate to use for the nova database
# Defaults to 'utf8_general_ci'
#
# [*allowed_hosts*]
# (optional) Additional hosts that are allowed to access this DB
# Defaults to undef
#
# [*setup_cell0*]
# (optional) Setup a cell0 for the cell_v2 functionality.
# Defaults to true
#
class nova::db::mysql_api(
$password,
$dbname = 'nova_api',
$user = 'nova_api',
$host = '127.0.0.1',
$charset = 'utf8',
$collate = 'utf8_general_ci',
$allowed_hosts = undef,
$setup_cell0 = true,
) {
include ::nova::deps
::openstacklib::db::mysql { 'nova_api':
user => $user,
password_hash => mysql_password($password),
dbname => $dbname,
host => $host,
charset => $charset,
collate => $collate,
allowed_hosts => $allowed_hosts,
}
if $setup_cell0 {
# need for cell_v2
::openstacklib::db::mysql { 'nova_api_cell0':
user => $user,
password_hash => mysql_password($password),
dbname => "${dbname}_cell0",
host => $host,
charset => $charset,
collate => $collate,
allowed_hosts => $allowed_hosts,
create_user => false,
}
}
Anchor['nova::db::begin']
~> Class['nova::db::mysql_api']
~> Anchor['nova::db::end']
}