Merge "add parameter to configure hostname of node"

This commit is contained in:
Jenkins 2016-06-02 03:18:14 +00:00 committed by Gerrit Code Review
commit ce07ac6031
2 changed files with 20 additions and 0 deletions
manifests
spec/classes

@ -58,6 +58,10 @@
# (optional) DHCP lease
# Defaults to $::os_service_default
#
# [*host*]
# (optional) Hostname to be used by the server, agents and services.
# Defaults to $::os_service_default
#
# [*dns_domain*]
# (optional) Domain to use for building the hostnames
# Defaults to $::os_service_default
@ -379,6 +383,7 @@ class neutron (
$base_mac = $::os_service_default,
$mac_generation_retries = $::os_service_default,
$dhcp_lease_duration = $::os_service_default,
$host = $::os_service_default,
$dns_domain = $::os_service_default,
$dhcp_agents_per_network = $::os_service_default,
$global_physnet_mtu = $::os_service_default,
@ -516,6 +521,7 @@ class neutron (
'DEFAULT/base_mac': value => $base_mac;
'DEFAULT/mac_generation_retries': value => $mac_generation_retries;
'DEFAULT/dhcp_lease_duration': value => $dhcp_lease_duration;
'DEFAULT/host': value => $host;
'DEFAULT/dns_domain': value => $dns_domain;
'DEFAULT/dhcp_agents_per_network': value => $dhcp_agents_per_network;
'DEFAULT/dhcp_agent_notification': value => $dhcp_agent_notification;

@ -81,6 +81,7 @@ describe 'neutron' do
it_configures 'with service_plugins'
it_configures 'without memcache_servers'
it_configures 'with memcache_servers'
it_configures 'with host defined'
it_configures 'with dns_domain defined'
it_configures 'with transport_url defined'
@ -134,6 +135,7 @@ describe 'neutron' do
is_expected.to contain_neutron_config('DEFAULT/base_mac').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/mac_generation_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/dhcp_lease_duration').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/dns_domain').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/dhcp_agents_per_network').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/global_physnet_mtu').with_value('<SERVICE DEFAULT>')
@ -440,6 +442,18 @@ describe 'neutron' do
end
end
shared_examples_for 'with host defined' do
before do
params.merge!(
:host => 'test-001.example.org'
)
end
it do
is_expected.to contain_neutron_config('DEFAULT/host').with_value(params[:host])
end
end
shared_examples_for 'with dns_domain defined' do
before do
params.merge!(