Implement exported resources for multi-node nova

This commit re-implements exported resources
to better support the deployment scenario where
nova compute nodes are split from the rest of
the deployment.

It removes the exported database connection.
The assumption is that all exported resources
should be explicitly performed by users implementing
their own modules.

It also removes references to cluster id used for collection.
This code is being removed b/c it is not fully implemented yet.
The basic design idea will later be reviewed and correctly implemented.

It ensures that conditional statements exist that determine rather
values have been supplied or if values for specific nova config should
be collected from the database.

The nova_config values that can possibly be collected are:
- rabbit_host
- glance_api_servers
- sql_connection
This commit is contained in:
Dan Bode 2012-04-15 11:38:17 -07:00
parent 020e38aaa6
commit 9fd5af8821
2 changed files with 29 additions and 21 deletions

View File

@ -12,13 +12,6 @@ class nova::db(
Mysql::Db[$dbname] -> Anchor<| title == "nova-start" |>
Mysql::Db[$dbname] ~> Exec<| title == 'initial-db-sync' |>
# TODO - worry about the security implications
# I am not sure if I want to use storeconfigs for this...
@@nova_config { 'database_url':
value => "mysql://${user}:${password}@${host}/${dbname}",
tag => $zone,
}
mysql::db { $dbname:
user => $user,
password => $password,

View File

@ -115,13 +115,37 @@ class nova(
}
# query out the config for our db connection
# TODO - I am not sure if resource collection should be the default
# both the sql_connection and rabbit_host are things
# that may need to be collected from a remote host
if $sql_connection {
nova_config { 'sql_connection': value => $sql_connection }
} else{
Nova_config<<| tag == $cluster_id and value == 'sql_connection' |>>
} else {
Nova_config <<| title == 'sql_connection' |>>
}
if $rabbit_host {
nova_config { 'rabbit_host': value => $rabbit_host }
} else {
Nova_config <<| title == 'rabbit_host' |>>
}
if $image_service == 'nova.image.glance.GlanceImageService' {
if $glance_api_servers {
nova_config {
'glance_api_servers': value => $glance_api_servers
}
} else {
# TODO this only supports setting a single address for the api server
Nova_config <<| title == $glance_api_servers |>>
}
}
# I may want to support exporting and collecting these
nova_config {
'rabbit_password': value => $rabbit_password;
'rabbit_port': value => $rabbit_port;
'rabbit_userid': value => $rabbit_userid;
'rabbit_virtual_host': value => $rabbit_virtual_host;
}
nova_config {
'verbose': value => $verbose;
@ -129,11 +153,6 @@ class nova(
'logdir': value => $logdir;
'image_service': value => $image_service;
'allow_admin_api': value => $allow_admin_api;
'rabbit_host': value => $rabbit_host;
'rabbit_password': value => $rabbit_password;
'rabbit_port': value => $rabbit_port;
'rabbit_userid': value => $rabbit_userid;
'rabbit_virtual_host': value => $rabbit_virtual_host;
# Following may need to be broken out to different nova services
'state_path': value => $state_path;
'lock_path': value => $lock_path;
@ -147,6 +166,7 @@ class nova(
'auth_strategy': value => $auth_strategy;
}
exec { 'post-nova_config':
command => '/bin/echo "Nova config has changed"',
refreshonly => true,
@ -178,9 +198,4 @@ class nova(
}
}
if $image_service == 'nova.image.glance.GlanceImageService' {
nova_config {
'glance_api_servers': value => $glance_api_servers;
}
}
}