diff --git a/manifests/agents/ml2/vpp.pp b/manifests/agents/ml2/vpp.pp index c3d4316f8..31dbf041d 100644 --- a/manifests/agents/ml2/vpp.pp +++ b/manifests/agents/ml2/vpp.pp @@ -16,6 +16,10 @@ # (optional) Whether to start/stop the service # Defaults to true # +# [*host*] +# (optional) Hostname to be used by the server, agents and services. +# Defaults to $::hostname +# # [*physnets*] # (optional) Comma-separated list of : # tuples mapping physical network names to agent's node-specific physical @@ -46,6 +50,7 @@ class neutron::agents::ml2::vpp ( $package_ensure = 'present', $enabled = true, $manage_service = true, + $host = $::host, $physnets = $::os_service_default, $etcd_host = $::os_service_default, $etcd_port = $::os_service_default, @@ -66,7 +71,7 @@ class neutron::agents::ml2::vpp ( 'ml2_vpp/etcd_port': value => $etcd_port; 'ml2_vpp/etcd_user': value => $etcd_user; 'ml2_vpp/etcd_pass': value => $etcd_pass; - 'DEFAULT/host': value => $::hostname; + 'DEFAULT/host': value => $host; } package { 'neutron-vpp-agent': diff --git a/releasenotes/notes/vpp-host-5df0f4bad5bb92fc.yaml b/releasenotes/notes/vpp-host-5df0f4bad5bb92fc.yaml new file mode 100644 index 000000000..986dde2c4 --- /dev/null +++ b/releasenotes/notes/vpp-host-5df0f4bad5bb92fc.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``host`` parameter has been added to + the ``neutron::agents::ml2::vpp`` class. diff --git a/spec/classes/neutron_agents_ml2_vpp_spec.rb b/spec/classes/neutron_agents_ml2_vpp_spec.rb index fe795b1c2..6df02cca2 100644 --- a/spec/classes/neutron_agents_ml2_vpp_spec.rb +++ b/spec/classes/neutron_agents_ml2_vpp_spec.rb @@ -65,6 +65,15 @@ describe 'neutron::agents::ml2::vpp' do end end + context 'with the host parameter' do + before :each do + params.merge!(:host => 'myhost') + end + it 'should set the host parameter' do + should contain_neutron_agent_vpp('DEFAULT/host').with_value('myhost') + end + end + context 'when supplying a physnet mapping' do before :each do params.merge!(:physnets => 'physnet0:GigabitEthernet2/2/0,physnet1:GigabitEthernet2/2/1')