Make nova::api params configurable

This patch adds three params:
	* nova_admin_tenant_name
	* nova_admin_user
	* enabled_apis

  fix Bug 1169402

Change-Id: I318bc61dc1f02d55b1d27ae00d6003be9c0be585
This commit is contained in:
newptone
2013-04-16 12:28:17 +08:00
committed by Gerrit Code Review
parent e0d1225906
commit 7f2eb3f341
5 changed files with 55 additions and 32 deletions

View File

@@ -31,12 +31,15 @@ class openstack::compute (
$network_manager = 'nova.network.manager.FlatDHCPManager',
$network_config = {},
$multi_host = false,
$enabled_apis = 'ec2,osapi_compute,metadata',
# Quantum
$quantum = false,
$quantum_host = false,
$quantum_user_password = false,
$keystone_host = false,
# Nova
$nova_admin_tenant_name = 'services',
$nova_admin_user = 'nova',
$purge_nova_config = true,
# Rabbit
$rabbit_host = '127.0.0.1',
@@ -127,10 +130,10 @@ class openstack::compute (
$enable_network_service = true
class { 'nova::api':
enabled => true,
admin_tenant_name => 'services',
admin_user => 'nova',
admin_tenant_name => $nova_admin_tenant_name,
admin_user => $nova_admin_user,
admin_password => $nova_user_password,
# TODO override enabled_apis
enabled_apis => $enabled_apis,
}
} else {
$enable_network_service = false

View File

@@ -102,9 +102,12 @@ class openstack::controller (
$glance_db_dbname = 'glance',
$glance_api_servers = undef,
# Nova
$nova_admin_tenant_name = 'services',
$nova_admin_user = 'nova',
$nova_db_user = 'nova',
$nova_db_dbname = 'nova',
$purge_nova_config = true,
$enabled_apis = 'ec2,osapi_compute,metadata',
# Network
$internal_address = false,
$admin_address = false,
@@ -270,10 +273,13 @@ class openstack::controller (
quantum_db_user => $quantum_db_user,
quantum_db_dbname => $quantum_db_dbname,
# Nova
nova_admin_tenant_name => $nova_admin_tenant_name,
nova_admin_user => $nova_admin_user,
nova_user_password => $nova_user_password,
nova_db_password => $nova_db_password,
nova_db_user => $nova_db_user,
nova_db_dbname => $nova_db_dbname,
enabled_apis => $enabled_apis,
# Rabbit
rabbit_user => $rabbit_user,
rabbit_password => $rabbit_password,

View File

@@ -49,8 +49,11 @@ class openstack::nova::controller (
$quantum_db_password = 'quantum_pass',
$quantum_user_password = 'quantum_pass',
# Nova
$nova_admin_tenant_name = 'services',
$nova_admin_user = 'nova',
$nova_db_user = 'nova',
$nova_db_dbname = 'nova',
$enabled_apis = 'ec2,osapi_compute,metadata',
# Rabbit
$rabbit_user = 'nova',
$rabbit_virtual_host = '/',
@@ -112,7 +115,10 @@ class openstack::nova::controller (
# Configure nova-api
class { 'nova::api':
enabled => $enabled,
admin_tenant_name => $nova_admin_tenant_name,
admin_user => $nova_admin_user,
admin_password => $nova_user_password,
enabled_apis => $enabled_apis,
auth_host => $keystone_host,
}

View File

@@ -10,6 +10,9 @@ describe 'openstack::compute' do
:rabbit_password => 'rabbit_pw',
:rabbit_host => '127.0.0.1',
:rabbit_virtual_host => '/',
:nova_admin_tenant_name => 'services',
:nova_admin_user => 'nova',
:enabled_apis => 'ec2,osapi_compute,metadata',
:sql_connection => 'mysql://user:pass@host/dbname/',
:cinder_sql_connection => 'mysql://user:pass@host/dbname/',
:quantum => false,
@@ -167,7 +170,8 @@ describe 'openstack::compute' do
:enabled => true,
:admin_tenant_name => 'services',
:admin_user => 'nova',
:admin_password => 'nova_pass'
:admin_password => 'nova_pass',
:enabled_apis => 'ec2,osapi_compute,metadata'
)}
end
end

View File

@@ -21,7 +21,10 @@ describe 'openstack::controller' do
:nova_user_password => 'nova_pass',
:secret_key => 'secret_key',
:quantum => false,
:vncproxy_host => '10.0.0.1'
:vncproxy_host => '10.0.0.1',
:nova_admin_tenant_name => 'services',
:nova_admin_user => 'nova',
:enabled_apis => 'ec2,osapi_compute,metadata',
}
end
@@ -352,7 +355,8 @@ describe 'openstack::controller' do
:enabled => true,
:admin_tenant_name => 'services',
:admin_user => 'nova',
:admin_password => 'nova_pass'
:admin_password => 'nova_pass',
:enabled_apis => 'ec2,osapi_compute,metadata'
)
should contain_class('nova::cert').with(:enabled => true)
should contain_class('nova::consoleauth').with(:enabled => true)