Merge "Nova now requires an api database to be created"
This commit is contained in:
@@ -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:
|
||||||
|
@@ -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
|
||||||
|
@@ -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',
|
||||||
|
}
|
@@ -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)
|
||||||
|
@@ -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');
|
||||||
}
|
}
|
||||||
|
@@ -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'));
|
||||||
}
|
}
|
||||||
|
@@ -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'),
|
||||||
@@ -32,18 +35,20 @@ $nova_common_notification_driver = hiera('CONFIG_CEILOMETER_INSTALL') ? {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class { '::nova':
|
class { '::nova':
|
||||||
glance_api_servers => "${nova_common_rabbitmq_cfg_storage_host}:9292",
|
glance_api_servers => "${nova_common_rabbitmq_cfg_storage_host}:9292",
|
||||||
rabbit_host => hiera('CONFIG_AMQP_HOST_URL'),
|
rabbit_host => hiera('CONFIG_AMQP_HOST_URL'),
|
||||||
rabbit_port => hiera('CONFIG_AMQP_CLIENTS_PORT'),
|
rabbit_port => hiera('CONFIG_AMQP_CLIENTS_PORT'),
|
||||||
rabbit_use_ssl => hiera('CONFIG_AMQP_SSL_ENABLED'),
|
rabbit_use_ssl => hiera('CONFIG_AMQP_SSL_ENABLED'),
|
||||||
rabbit_userid => hiera('CONFIG_AMQP_AUTH_USER'),
|
rabbit_userid => hiera('CONFIG_AMQP_AUTH_USER'),
|
||||||
rabbit_password => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
|
rabbit_password => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
|
||||||
verbose => true,
|
verbose => true,
|
||||||
debug => hiera('CONFIG_DEBUG_MODE'),
|
debug => hiera('CONFIG_DEBUG_MODE'),
|
||||||
nova_public_key => $public_key,
|
nova_public_key => $public_key,
|
||||||
nova_private_key => $private_key,
|
nova_private_key => $private_key,
|
||||||
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
|
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
|
||||||
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",
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user