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

View File

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

View File

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

View File

@@ -4,16 +4,19 @@ describe 'openstack::compute' do
let :default_params do let :default_params do
{ {
:private_interface => 'eth0', :private_interface => 'eth0',
:internal_address => '0.0.0.0', :internal_address => '0.0.0.0',
:nova_user_password => 'nova_pass', :nova_user_password => 'nova_pass',
:rabbit_password => 'rabbit_pw', :rabbit_password => 'rabbit_pw',
:rabbit_host => '127.0.0.1', :rabbit_host => '127.0.0.1',
:rabbit_virtual_host => '/', :rabbit_virtual_host => '/',
:sql_connection => 'mysql://user:pass@host/dbname/', :nova_admin_tenant_name => 'services',
:cinder_sql_connection => 'mysql://user:pass@host/dbname/', :nova_admin_user => 'nova',
:quantum => false, :enabled_apis => 'ec2,osapi_compute,metadata',
:fixed_range => '10.0.0.0/16', :sql_connection => 'mysql://user:pass@host/dbname/',
:cinder_sql_connection => 'mysql://user:pass@host/dbname/',
:quantum => false,
:fixed_range => '10.0.0.0/16',
} }
end end
@@ -167,7 +170,8 @@ describe 'openstack::compute' do
:enabled => true, :enabled => true,
:admin_tenant_name => 'services', :admin_tenant_name => 'services',
:admin_user => 'nova', :admin_user => 'nova',
:admin_password => 'nova_pass' :admin_password => 'nova_pass',
:enabled_apis => 'ec2,osapi_compute,metadata'
)} )}
end end
end end

View File

@@ -5,23 +5,26 @@ describe 'openstack::controller' do
# minimum set of default parameters # minimum set of default parameters
let :default_params do let :default_params do
{ {
:private_interface => 'eth0', :private_interface => 'eth0',
:public_interface => 'eth1', :public_interface => 'eth1',
:internal_address => '127.0.0.1', :internal_address => '127.0.0.1',
:public_address => '10.0.0.1', :public_address => '10.0.0.1',
:admin_email => 'some_user@some_fake_email_address.foo', :admin_email => 'some_user@some_fake_email_address.foo',
:admin_password => 'ChangeMe', :admin_password => 'ChangeMe',
:rabbit_password => 'rabbit_pw', :rabbit_password => 'rabbit_pw',
:rabbit_virtual_host => '/', :rabbit_virtual_host => '/',
:keystone_db_password => 'keystone_pass', :keystone_db_password => 'keystone_pass',
:keystone_admin_token => 'keystone_admin_token', :keystone_admin_token => 'keystone_admin_token',
:glance_db_password => 'glance_pass', :glance_db_password => 'glance_pass',
:glance_user_password => 'glance_pass', :glance_user_password => 'glance_pass',
:nova_db_password => 'nova_pass', :nova_db_password => 'nova_pass',
:nova_user_password => 'nova_pass', :nova_user_password => 'nova_pass',
:secret_key => 'secret_key', :secret_key => 'secret_key',
:quantum => false, :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 end
@@ -352,7 +355,8 @@ describe 'openstack::controller' do
:enabled => true, :enabled => true,
:admin_tenant_name => 'services', :admin_tenant_name => 'services',
:admin_user => 'nova', :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::cert').with(:enabled => true)
should contain_class('nova::consoleauth').with(:enabled => true) should contain_class('nova::consoleauth').with(:enabled => true)