Nova now requires an api database to be created

This enables the creation of the nova_api database that is now
mandatory since https://review.openstack.org/#/c/245828/

Change-Id: I8c8530e7711891d3de3bf0b25fe0c8ecb4e8b028
Related-Bug: #1539793
This commit is contained in:
David Moreau Simard 2016-02-05 11:07:02 -05:00 committed by Javier Pena
parent c1f7809209
commit 790a392235
7 changed files with 43 additions and 17 deletions

View File

@ -45,6 +45,14 @@ class ManifestFiles(object):
self.filelist.append((filename, marker))
def prependFile(self, filename, marker, data=''):
self.data[filename] = data + '\n' + self.data.get(filename, '')
for f, p in self.filelist:
if f == filename:
return
self.filelist.append((filename, marker))
def getFiles(self):
return [f for f in self.filelist]
@ -76,6 +84,10 @@ def appendManifestFile(manifest_name, data, marker=''):
manifestfiles.addFile(manifest_name, marker, data)
def prependManifestFile(manifest_name, data, marker=''):
manifestfiles.prependFile(manifest_name, marker, data)
def generateHieraDataFile():
os.mkdir(basedefs.HIERADATA_DIR, 0o700)
with open(HIERA_DEFAULTS_YAML, 'w') as outfile:

View File

@ -30,6 +30,7 @@ from packstack.modules import common
from packstack.modules.documentation import update_params_usage
from packstack.modules.shortcuts import get_mq
from packstack.modules.ospluginutils import appendManifestFile
from packstack.modules.ospluginutils import prependManifestFile
from packstack.modules.ospluginutils import createFirewallResources
from packstack.modules.ospluginutils import deliver_ssl_file
from packstack.modules.ospluginutils import getManifestTemplate
@ -812,6 +813,7 @@ def create_vncproxy_manifest(config, messages):
def create_common_manifest(config, messages):
global compute_hosts, network_hosts
network_type = (config['CONFIG_NEUTRON_INSTALL'] == "y" and
'neutron' or 'nova')
network_multi = len(network_hosts) > 1
@ -854,7 +856,9 @@ def create_common_manifest(config, messages):
data += getManifestTemplate("nova_common_pw")
else:
data += getManifestTemplate("nova_common_nopw")
appendManifestFile(os.path.split(manifestfile)[1], data)
# We need to have class nova before class nova::api, so prepend
# instead of append
prependManifestFile(os.path.split(manifestfile)[1], data)
if config['CONFIG_AMQP_ENABLE_SSL'] == 'y':
nova_hosts = compute_hosts

View File

@ -4,3 +4,9 @@ class { '::nova::db::mysql':
allowed_hosts => '%%',
charset => 'utf8',
}
class { '::nova::db::mysql_api':
password => hiera('CONFIG_NOVA_DB_PW'),
host => '%%',
allowed_hosts => '%%',
charset => 'utf8',
}

View File

@ -23,6 +23,7 @@ class { '::nova::api':
neutron_metadata_proxy_shared_secret => hiera('CONFIG_NEUTRON_METADATA_PW_UNQUOTED', undef),
default_floating_pool => $default_floating_pool,
pci_alias => hiera('CONFIG_NOVA_PCI_ALIAS'),
sync_db_api => true
}
Package<| title == 'nova-common' |> -> Class['nova::api']

View File

@ -3,6 +3,5 @@
Firewall <| |> -> Class['nova']
nova_config{
'DEFAULT/sql_connection': value => hiera('CONFIG_NOVA_SQL_CONN_NOPW');
'DEFAULT/metadata_host': value => hiera('CONFIG_CONTROLLER_HOST');
}

View File

@ -3,7 +3,6 @@
Firewall <| |> -> Class['nova']
nova_config{
'DEFAULT/sql_connection': value => hiera('CONFIG_NOVA_SQL_CONN_PW');
# metadata_host has to be IP
'DEFAULT/metadata_host': value => force_ip(hiera('CONFIG_CONTROLLER_HOST'));
}

View File

@ -1,3 +1,6 @@
$nova_db_pw = hiera('CONFIG_NOVA_DB_PW')
$nova_mariadb_host = hiera('CONFIG_MARIADB_HOST_URL')
$private_key = {
'type' => hiera('NOVA_MIGRATION_KEY_TYPE'),
key => hiera('NOVA_MIGRATION_KEY_SECRET'),
@ -32,18 +35,20 @@ $nova_common_notification_driver = hiera('CONFIG_CEILOMETER_INSTALL') ? {
}
class { '::nova':
glance_api_servers => "${nova_common_rabbitmq_cfg_storage_host}:9292",
rabbit_host => hiera('CONFIG_AMQP_HOST_URL'),
rabbit_port => hiera('CONFIG_AMQP_CLIENTS_PORT'),
rabbit_use_ssl => hiera('CONFIG_AMQP_SSL_ENABLED'),
rabbit_userid => hiera('CONFIG_AMQP_AUTH_USER'),
rabbit_password => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
verbose => true,
debug => hiera('CONFIG_DEBUG_MODE'),
nova_public_key => $public_key,
nova_private_key => $private_key,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile,
notification_driver => $nova_common_notification_driver,
glance_api_servers => "${nova_common_rabbitmq_cfg_storage_host}:9292",
rabbit_host => hiera('CONFIG_AMQP_HOST_URL'),
rabbit_port => hiera('CONFIG_AMQP_CLIENTS_PORT'),
rabbit_use_ssl => hiera('CONFIG_AMQP_SSL_ENABLED'),
rabbit_userid => hiera('CONFIG_AMQP_AUTH_USER'),
rabbit_password => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
verbose => true,
debug => hiera('CONFIG_DEBUG_MODE'),
nova_public_key => $public_key,
nova_private_key => $private_key,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile,
notification_driver => $nova_common_notification_driver,
database_connection => "mysql+pymysql://nova:${nova_db_pw}@${nova_mariadb_host}/nova",
api_database_connection => "mysql+pymysql://nova_api:${nova_db_pw}@${nova_mariadb_host}/nova_api",
}