Merge "Nova now requires an api database to be created"

This commit is contained in:
Jenkins
2016-02-08 22:54:07 +00:00
committed by Gerrit Code Review
7 changed files with 43 additions and 17 deletions

View File

@@ -45,6 +45,14 @@ class ManifestFiles(object):
self.filelist.append((filename, marker)) 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): def getFiles(self):
return [f for f in self.filelist] return [f for f in self.filelist]
@@ -76,6 +84,10 @@ def appendManifestFile(manifest_name, data, marker=''):
manifestfiles.addFile(manifest_name, marker, data) manifestfiles.addFile(manifest_name, marker, data)
def prependManifestFile(manifest_name, data, marker=''):
manifestfiles.prependFile(manifest_name, marker, data)
def generateHieraDataFile(): def generateHieraDataFile():
os.mkdir(basedefs.HIERADATA_DIR, 0o700) os.mkdir(basedefs.HIERADATA_DIR, 0o700)
with open(HIERA_DEFAULTS_YAML, 'w') as outfile: 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.documentation import update_params_usage
from packstack.modules.shortcuts import get_mq from packstack.modules.shortcuts import get_mq
from packstack.modules.ospluginutils import appendManifestFile from packstack.modules.ospluginutils import appendManifestFile
from packstack.modules.ospluginutils import prependManifestFile
from packstack.modules.ospluginutils import createFirewallResources from packstack.modules.ospluginutils import createFirewallResources
from packstack.modules.ospluginutils import deliver_ssl_file from packstack.modules.ospluginutils import deliver_ssl_file
from packstack.modules.ospluginutils import getManifestTemplate from packstack.modules.ospluginutils import getManifestTemplate
@@ -812,6 +813,7 @@ def create_vncproxy_manifest(config, messages):
def create_common_manifest(config, messages): def create_common_manifest(config, messages):
global compute_hosts, network_hosts global compute_hosts, network_hosts
network_type = (config['CONFIG_NEUTRON_INSTALL'] == "y" and network_type = (config['CONFIG_NEUTRON_INSTALL'] == "y" and
'neutron' or 'nova') 'neutron' or 'nova')
network_multi = len(network_hosts) > 1 network_multi = len(network_hosts) > 1
@@ -854,7 +856,9 @@ def create_common_manifest(config, messages):
data += getManifestTemplate("nova_common_pw") data += getManifestTemplate("nova_common_pw")
else: else:
data += getManifestTemplate("nova_common_nopw") 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': if config['CONFIG_AMQP_ENABLE_SSL'] == 'y':
nova_hosts = compute_hosts nova_hosts = compute_hosts

View File

@@ -4,3 +4,9 @@ class { '::nova::db::mysql':
allowed_hosts => '%%', allowed_hosts => '%%',
charset => 'utf8', 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), neutron_metadata_proxy_shared_secret => hiera('CONFIG_NEUTRON_METADATA_PW_UNQUOTED', undef),
default_floating_pool => $default_floating_pool, default_floating_pool => $default_floating_pool,
pci_alias => hiera('CONFIG_NOVA_PCI_ALIAS'), pci_alias => hiera('CONFIG_NOVA_PCI_ALIAS'),
sync_db_api => true
} }
# TO-DO: Remove this workaround as soon as module support is implemented (see rhbz#1300662) # TO-DO: Remove this workaround as soon as module support is implemented (see rhbz#1300662)

View File

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

View File

@@ -3,7 +3,6 @@
Firewall <| |> -> Class['nova'] Firewall <| |> -> Class['nova']
nova_config{ nova_config{
'DEFAULT/sql_connection': value => hiera('CONFIG_NOVA_SQL_CONN_PW');
# metadata_host has to be IP # metadata_host has to be IP
'DEFAULT/metadata_host': value => force_ip(hiera('CONFIG_CONTROLLER_HOST')); '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 = { $private_key = {
'type' => hiera('NOVA_MIGRATION_KEY_TYPE'), 'type' => hiera('NOVA_MIGRATION_KEY_TYPE'),
key => hiera('NOVA_MIGRATION_KEY_SECRET'), key => hiera('NOVA_MIGRATION_KEY_SECRET'),
@@ -46,4 +49,6 @@ class { '::nova':
kombu_ssl_keyfile => $kombu_ssl_keyfile, kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile, kombu_ssl_certfile => $kombu_ssl_certfile,
notification_driver => $nova_common_notification_driver, 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",
} }