Add Support for Nova API Bind Address

Previously, Nova would always bind to '0.0.0.0'.

This change allows users to specify the IP address for
binding Nova API endpoints.

The change introduces the api_bind_address parameter within the
openstack::nova::controller class and the nova_bind_address in
the openstack::controller class.  nova_bind_address was used for
consistency with other OpenStack services.

Defaults to '0.0.0.0' for backwards compatibility and to have all
Nova API's bind to all IP addresses.

Change-Id: I467e9259f8dea75a265e1cc063bea7305f918307
This commit is contained in:
danehans
2013-07-16 18:31:03 +00:00
parent 019e13ddde
commit 5f5c4fd457
4 changed files with 17 additions and 1 deletions

View File

@@ -25,6 +25,10 @@
# Whether unmanaged nova.conf entries should be purged.
# (optional) Defaults to false.
#
# [nova_bind_address]
# IP address to use for binding Nova API's.
# (optional) Defualts to '0.0.0.0'.
#
# [rabbit_password] Rabbit password.
# [rabbit_user] Rabbit User. Optional. Defaults to openstack.
# [rabbit_virtual_host] Rabbit virtual host path for Nova. Defaults to '/'.
@@ -146,6 +150,7 @@ class openstack::controller (
$nova_db_dbname = 'nova',
$purge_nova_config = false,
$enabled_apis = 'ec2,osapi_compute,metadata',
$nova_bind_address = '0.0.0.0',
# Nova Networking
$public_interface = false,
$private_interface = false,
@@ -353,6 +358,7 @@ class openstack::controller (
nova_db_user => $nova_db_user,
nova_db_dbname => $nova_db_dbname,
enabled_apis => $enabled_apis,
api_bind_address => $nova_bind_address,
# Rabbit
rabbit_user => $rabbit_user,
rabbit_password => $rabbit_password,

View File

@@ -11,6 +11,10 @@
# Supply a list of memcached server IP's:Memcached Port.
# (optional) Defaults to false.
#
# [api_bind_address]
# IP address to use for binding Nova API's.
# (optional) Defaults to '0.0.0.0'.
#
# [quantum]
# Specifies if nova should be configured to use quantum.
# (optional) Defaults to false (indicating nova-networks should be used)
@@ -71,6 +75,7 @@ class openstack::nova::controller (
$nova_db_dbname = 'nova',
$enabled_apis = 'ec2,osapi_compute,metadata',
$memcached_servers = false,
$api_bind_address = '0.0.0.0',
# Rabbit
$rabbit_user = 'openstack',
$rabbit_virtual_host = '/',
@@ -144,6 +149,7 @@ class openstack::nova::controller (
admin_user => $nova_admin_user,
admin_password => $nova_user_password,
enabled_apis => $enabled_apis,
api_bind_address => $api_bind_address,
auth_host => $keystone_host,
quantum_metadata_proxy_shared_secret => $metadata_shared_secret,
}

View File

@@ -17,6 +17,7 @@ describe 'openstack::controller' do
:keystone_admin_token => 'keystone_admin_token',
:glance_db_password => 'glance_pass',
:glance_user_password => 'glance_pass',
:nova_bind_address => '0.0.0.0',
:nova_db_password => 'nova_pass',
:nova_user_password => 'nova_pass',
:cinder_db_password => 'cinder_pass',
@@ -394,7 +395,8 @@ describe 'openstack::controller' do
:admin_tenant_name => 'services',
:admin_user => 'nova',
:admin_password => 'nova_pass',
:enabled_apis => 'ec2,osapi_compute,metadata'
:enabled_apis => 'ec2,osapi_compute,metadata',
:api_bind_address => '0.0.0.0'
)
should contain_class('nova::cert').with(:enabled => true)
should contain_class('nova::consoleauth').with(:enabled => true)

View File

@@ -6,6 +6,7 @@ describe 'openstack::nova::controller' do
{
:public_address => '127.0.0.1',
:db_host => '127.0.0.1',
:api_bind_address => '0.0.0.0',
:rabbit_password => 'rabbit_pass',
:nova_user_password => 'nova_user_pass',
:quantum_user_password => 'quantum_user_pass',
@@ -54,6 +55,7 @@ describe 'openstack::nova::controller' do
:admin_user => 'nova',
:admin_password => 'nova_user_pass',
:enabled_apis => 'ec2,osapi_compute,metadata',
:api_bind_address => '0.0.0.0',
:auth_host => '127.0.0.1',
:quantum_metadata_proxy_shared_secret => 'secret'
)