Merge "Don't specify a nova region by default"

This commit is contained in:
Jenkins
2015-06-12 12:59:25 +00:00
committed by Gerrit Code Review
3 changed files with 31 additions and 13 deletions

View File

@@ -40,7 +40,7 @@
# CA cert to check against with for ssl keystone. (Defaults to undef) # CA cert to check against with for ssl keystone. (Defaults to undef)
# #
# [*auth_region*] # [*auth_region*]
# The authentication region. Defaults to 'RegionOne'. # The authentication region. (Defaults to undef)
# #
# [*metadata_ip*] # [*metadata_ip*]
# The IP address of the metadata service. Defaults to '127.0.0.1'. # The IP address of the metadata service. Defaults to '127.0.0.1'.
@@ -83,7 +83,7 @@ class neutron::agents::metadata (
$auth_url = 'http://localhost:35357/v2.0', $auth_url = 'http://localhost:35357/v2.0',
$auth_insecure = false, $auth_insecure = false,
$auth_ca_cert = undef, $auth_ca_cert = undef,
$auth_region = 'RegionOne', $auth_region = undef,
$metadata_ip = '127.0.0.1', $metadata_ip = '127.0.0.1',
$metadata_port = '8775', $metadata_port = '8775',
$metadata_protocol = 'http', $metadata_protocol = 'http',
@@ -102,7 +102,6 @@ class neutron::agents::metadata (
'DEFAULT/debug': value => $debug; 'DEFAULT/debug': value => $debug;
'DEFAULT/auth_url': value => $auth_url; 'DEFAULT/auth_url': value => $auth_url;
'DEFAULT/auth_insecure': value => $auth_insecure; 'DEFAULT/auth_insecure': value => $auth_insecure;
'DEFAULT/auth_region': value => $auth_region;
'DEFAULT/admin_tenant_name': value => $auth_tenant; 'DEFAULT/admin_tenant_name': value => $auth_tenant;
'DEFAULT/admin_user': value => $auth_user; 'DEFAULT/admin_user': value => $auth_user;
'DEFAULT/admin_password': value => $auth_password, secret => true; 'DEFAULT/admin_password': value => $auth_password, secret => true;
@@ -114,6 +113,16 @@ class neutron::agents::metadata (
'DEFAULT/metadata_backlog': value => $metadata_backlog; 'DEFAULT/metadata_backlog': value => $metadata_backlog;
} }
if $auth_region {
neutron_metadata_agent_config {
'DEFAULT/auth_region': value => $auth_region;
}
} else {
neutron_metadata_agent_config {
'DEFAULT/auth_region': ensure => absent;
}
}
if $metadata_memory_cache_ttl { if $metadata_memory_cache_ttl {
neutron_metadata_agent_config { neutron_metadata_agent_config {
'DEFAULT/cache_url': value => "memory://?default_ttl=${metadata_memory_cache_ttl}"; 'DEFAULT/cache_url': value => "memory://?default_ttl=${metadata_memory_cache_ttl}";

View File

@@ -57,7 +57,7 @@
# [*nova_region_name*] # [*nova_region_name*]
# (optional) Name of nova region to use. Useful if keystone manages more than # (optional) Name of nova region to use. Useful if keystone manages more than
# one region. # one region.
# Defaults to 'RegionOne' # Defaults to undef
# #
class neutron::server::notifications ( class neutron::server::notifications (
@@ -70,7 +70,7 @@ class neutron::server::notifications (
$nova_admin_tenant_name = 'services', $nova_admin_tenant_name = 'services',
$nova_admin_tenant_id = undef, $nova_admin_tenant_id = undef,
$nova_admin_password = false, $nova_admin_password = false,
$nova_region_name = 'RegionOne', $nova_region_name = undef,
) { ) {
# Depend on the specified keystone_user resource, if it exists. # Depend on the specified keystone_user resource, if it exists.
@@ -92,8 +92,17 @@ class neutron::server::notifications (
'DEFAULT/nova_admin_auth_url': value => $nova_admin_auth_url; 'DEFAULT/nova_admin_auth_url': value => $nova_admin_auth_url;
'DEFAULT/nova_admin_username': value => $nova_admin_username; 'DEFAULT/nova_admin_username': value => $nova_admin_username;
'DEFAULT/nova_admin_password': value => $nova_admin_password, secret => true; 'DEFAULT/nova_admin_password': value => $nova_admin_password, secret => true;
}
if $nova_region_name {
neutron_config {
'DEFAULT/nova_region_name': value => $nova_region_name; 'DEFAULT/nova_region_name': value => $nova_region_name;
} }
} else {
neutron_config {
'DEFAULT/nova_region_name': ensure => absent;
}
}
if $nova_admin_tenant_id { if $nova_admin_tenant_id {
neutron_config { neutron_config {

View File

@@ -29,7 +29,7 @@ describe 'neutron::server::notifications' do
:nova_admin_auth_url => 'http://127.0.0.1:35357/v2.0', :nova_admin_auth_url => 'http://127.0.0.1:35357/v2.0',
:nova_admin_username => 'nova', :nova_admin_username => 'nova',
:nova_admin_tenant_name => 'services', :nova_admin_tenant_name => 'services',
:nova_region_name => 'RegionOne' :nova_region_name => nil,
} }
end end
@@ -54,8 +54,8 @@ describe 'neutron::server::notifications' do
is_expected.to contain_neutron_config('DEFAULT/nova_admin_username').with_value('nova') is_expected.to contain_neutron_config('DEFAULT/nova_admin_username').with_value('nova')
is_expected.to contain_neutron_config('DEFAULT/nova_admin_password').with_value('secrete') is_expected.to contain_neutron_config('DEFAULT/nova_admin_password').with_value('secrete')
is_expected.to contain_neutron_config('DEFAULT/nova_admin_password').with_secret( true ) is_expected.to contain_neutron_config('DEFAULT/nova_admin_password').with_secret( true )
is_expected.to contain_neutron_config('DEFAULT/nova_region_name').with_value('RegionOne')
is_expected.to contain_neutron_config('DEFAULT/nova_admin_tenant_id').with_value('UUID') is_expected.to contain_neutron_config('DEFAULT/nova_admin_tenant_id').with_value('UUID')
is_expected.to contain_neutron_config('DEFAULT/nova_region_name').with_ensure('absent')
end end
context 'when overriding parameters' do context 'when overriding parameters' do