Add support for nova_metadata_host in metadata configuration

this allows hostnames and not just IPs.

Change-Id: I9df395dc699090bd73265d10395e155e9b8adb26
This commit is contained in:
Juan Antonio Osorio Robles 2017-08-17 20:18:36 +03:00 committed by Ade Lee
parent 44ecd3e8ec
commit 01396ee558
3 changed files with 12 additions and 0 deletions

View File

@ -32,6 +32,9 @@
# [*metadata_ip*]
# The IP address of the metadata service. Defaults to $::os_service_default.
#
# [*metadata_host*]
# The hostname of the metadata service. Defaults to $::os_service_default.
#
# [*metadata_port*]
# The TCP port of the metadata service. Defaults to $::os_service_default.
#
@ -72,6 +75,7 @@ class neutron::agents::metadata (
$debug = false,
$auth_ca_cert = $::os_service_default,
$metadata_ip = $::os_service_default,
$metadata_host = $::os_service_default,
$metadata_port = $::os_service_default,
$metadata_protocol = $::os_service_default,
$metadata_workers = $::os_workers,
@ -94,6 +98,7 @@ class neutron::agents::metadata (
'DEFAULT/debug': value => $debug;
'DEFAULT/auth_ca_cert': value => $auth_ca_cert;
'DEFAULT/nova_metadata_ip': value => $metadata_ip;
'DEFAULT/nova_metadata_host': value => $metadata_host;
'DEFAULT/nova_metadata_port': value => $metadata_port;
'DEFAULT/nova_metadata_protocol': value => $metadata_protocol;
'DEFAULT/nova_metadata_insecure': value => $metadata_insecure;

View File

@ -0,0 +1,6 @@
---
features:
- |
The parameter metadata_host was added to the metadata agent resource. This
sets the nova_metadata_host value which is meant to replace the
nova_metadata_ip value and allows you to set hostnames instead of just IPs.

View File

@ -57,6 +57,7 @@ describe 'neutron::agents::metadata' do
is_expected.to contain_neutron_metadata_agent_config('DEFAULT/nova_client_cert').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_metadata_agent_config('DEFAULT/nova_client_priv_key').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_ip').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_host').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_port').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_protocol').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_metadata_agent_config('DEFAULT/metadata_workers').with(:value => facts[:os_workers])