diff --git a/manifests/agents/ml2/networking_baremetal.pp b/manifests/agents/ml2/networking_baremetal.pp index e3d7dbf96..9e705ab48 100644 --- a/manifests/agents/ml2/networking_baremetal.pp +++ b/manifests/agents/ml2/networking_baremetal.pp @@ -123,11 +123,6 @@ class neutron::agents::ml2::networking_baremetal ( include neutron::deps include neutron::params - if($::osfamily != 'RedHat') { - # Drivers are only packaged for RedHat at this time - fail("Unsupported osfamily ${::osfamily}") - } - resources { 'ironic_neutron_agent_config': purge => $purge_config, } diff --git a/manifests/params.pp b/manifests/params.pp index ca822790b..e0e61a168 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -74,48 +74,51 @@ class neutron::params { $networking_ansible_package = 'python3-networking-ansible' $mlnx_agent_service = 'neutron-mlnx-agent' } elsif($::osfamily == 'Debian') { - $package_name = 'neutron-common' + $package_name = 'neutron-common' if $::operatingsystem == 'Debian' { - $ml2_server_package = false - $server_service = false - $server_package = false - $api_package_name = 'neutron-api' - $api_service_name = 'neutron-api' - $rpc_package_name = 'neutron-rpc-server' - $rpc_service_name = 'neutron-rpc-server' - $dynamic_routing_package = 'python3-neutron-dynamic-routing' + $ml2_server_package = false + $server_service = false + $server_package = false + $api_package_name = 'neutron-api' + $api_service_name = 'neutron-api' + $rpc_package_name = 'neutron-rpc-server' + $rpc_service_name = 'neutron-rpc-server' + $dynamic_routing_package = 'python3-neutron-dynamic-routing' } else { $ml2_server_package = 'neutron-plugin-ml2' - $server_service = 'neutron-server' - $server_package = 'neutron-server' - $api_package_name = false - $api_service_name = false - $rpc_package_name = false - $rpc_service_name = false - $dynamic_routing_package = 'python3-neutron-dynamic-routing' + $server_service = 'neutron-server' + $server_package = 'neutron-server' + $api_package_name = false + $api_service_name = false + $rpc_package_name = false + $rpc_service_name = false + $dynamic_routing_package = 'python3-neutron-dynamic-routing' } - $bgp_dragent_package = 'neutron-bgp-dragent' - $ovs_agent_package = 'neutron-openvswitch-agent' - $ovs_server_package = 'neutron-plugin-openvswitch' - $ovs_cleanup_service = false - $linuxbridge_agent_package = 'neutron-linuxbridge-agent' - $linuxbridge_server_package = 'neutron-plugin-linuxbridge' - $sriov_nic_agent_service = 'neutron-sriov-agent' - $sriov_nic_agent_package = 'neutron-sriov-agent' - $nvp_server_package = 'neutron-plugin-nicira' - $dhcp_agent_package = 'neutron-dhcp-agent' - $metering_agent_package = 'neutron-metering-agent' - $vpnaas_agent_package = 'python3-neutron-vpnaas' - $openswan_package = 'strongswan' - $libreswan_package = false - $metadata_agent_package = 'neutron-metadata-agent' - $l3_agent_package = 'neutron-l3-agent' - $l2gw_agent_package = 'neutron-l2gateway-agent' - $l2gw_package = 'python3-networking-l2gw' - $ovn_metadata_agent_package = 'neutron-ovn-metadata-agent' - $neutron_wsgi_script_path = '/usr/lib/cgi-bin/neutron' - $neutron_wsgi_script_source = '/usr/bin/neutron-api' - $mlnx_agent_service = 'neutron-plugin-mlnx-agent' + $bgp_dragent_package = 'neutron-bgp-dragent' + $ovs_agent_package = 'neutron-openvswitch-agent' + $ovs_server_package = 'neutron-plugin-openvswitch' + $ovs_cleanup_service = false + $linuxbridge_agent_package = 'neutron-linuxbridge-agent' + $linuxbridge_server_package = 'neutron-plugin-linuxbridge' + $sriov_nic_agent_service = 'neutron-sriov-agent' + $sriov_nic_agent_package = 'neutron-sriov-agent' + $nvp_server_package = 'neutron-plugin-nicira' + $dhcp_agent_package = 'neutron-dhcp-agent' + $metering_agent_package = 'neutron-metering-agent' + $vpnaas_agent_package = 'python3-neutron-vpnaas' + $openswan_package = 'strongswan' + $libreswan_package = false + $metadata_agent_package = 'neutron-metadata-agent' + $l3_agent_package = 'neutron-l3-agent' + $l2gw_agent_package = 'neutron-l2gateway-agent' + $l2gw_package = 'python3-networking-l2gw' + $ovn_metadata_agent_package = 'neutron-ovn-metadata-agent' + $neutron_wsgi_script_path = '/usr/lib/cgi-bin/neutron' + $neutron_wsgi_script_source = '/usr/bin/neutron-api' + $networking_baremetal_package = 'python3-ironic-neutron-agent' + $networking_baremetal_agent_package = 'ironic-neutron-agent' + $networking_baremetal_agent_service = 'ironic-neutron-agent' + $mlnx_agent_service = 'neutron-plugin-mlnx-agent' } else { fail("Unsupported osfamily ${::osfamily}") } diff --git a/manifests/plugins/ml2/networking_baremetal.pp b/manifests/plugins/ml2/networking_baremetal.pp index 6c95f9374..89e1a5905 100644 --- a/manifests/plugins/ml2/networking_baremetal.pp +++ b/manifests/plugins/ml2/networking_baremetal.pp @@ -17,14 +17,9 @@ class neutron::plugins::ml2::networking_baremetal( include neutron::deps include neutron::params - if($::osfamily != 'RedHat') { - # Drivers are only packaged for RedHat at this time - fail("Unsupported osfamily ${::osfamily}") - } else { - package { 'python-networking-baremetal': - ensure => $package_ensure, - name => $::neutron::params::networking_baremetal_package, - tag => ['openstack', 'neutron-plugin-ml2-package'], - } + package { 'python-networking-baremetal': + ensure => $package_ensure, + name => $::neutron::params::networking_baremetal_package, + tag => ['openstack', 'neutron-plugin-ml2-package'], } } diff --git a/releasenotes/notes/networking_baremetal-debian-563498e4af59a1bb.yaml b/releasenotes/notes/networking_baremetal-debian-563498e4af59a1bb.yaml new file mode 100644 index 000000000..926b60fc6 --- /dev/null +++ b/releasenotes/notes/networking_baremetal-debian-563498e4af59a1bb.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Now this module supports configuration of networking-baremetal in Debian + and Ubuntu. Previously it was supported in RHEL/CentOS only. diff --git a/spec/classes/neutron_agents_ml2_networking_baremetal_spec.rb b/spec/classes/neutron_agents_ml2_networking_baremetal_spec.rb index 83c1c4ef3..433db0433 100644 --- a/spec/classes/neutron_agents_ml2_networking_baremetal_spec.rb +++ b/spec/classes/neutron_agents_ml2_networking_baremetal_spec.rb @@ -22,7 +22,7 @@ describe 'neutron::agents::ml2::networking_baremetal' do } end - shared_examples 'networking-baremetal ironic-neutron-agent with ml2 plugin' do + shared_examples 'neutron::agents::ml2::networking_baremetal' do let :p do default_params.merge(params) end @@ -124,21 +124,19 @@ describe 'neutron::agents::ml2::networking_baremetal' do let (:facts) do facts.merge!(OSDefaults.get_facts()) end + let (:platform_params) do case facts[:osfamily] + when 'Debian' + { :networking_baremetal_agent_package => 'ironic-neutron-agent', + :networking_baremetal_agent_service => 'ironic-neutron-agent' } when 'RedHat' { :networking_baremetal_agent_package => 'python3-ironic-neutron-agent', :networking_baremetal_agent_service => 'ironic-neutron-agent' } end end - case facts[:osfamily] - when 'RedHat' - it_behaves_like 'networking-baremetal ironic-neutron-agent with ml2 plugin' - when facts[:osfamily] != 'RedHat' - it 'fails with unsupported osfamily' do - should raise_error(Puppet::Error, /Unsupported osfamily.*/) - end - end + + it_behaves_like 'neutron::agents::ml2::networking_baremetal' end end end diff --git a/spec/classes/neutron_plugins_ml2_networking_baremetal_spec.rb b/spec/classes/neutron_plugins_ml2_networking_baremetal_spec.rb index 60a60c763..e4d045483 100644 --- a/spec/classes/neutron_plugins_ml2_networking_baremetal_spec.rb +++ b/spec/classes/neutron_plugins_ml2_networking_baremetal_spec.rb @@ -39,19 +39,13 @@ describe 'neutron::plugins::ml2::networking_baremetal' do let (:platform_params) do case facts[:osfamily] when 'Debian' - { :networking_baremetal_package => 'python3-networking-baremetal'} + { :networking_baremetal_package => 'python3-ironic-neutron-agent'} when 'RedHat' { :networking_baremetal_package => 'python3-networking-baremetal'} end end - case facts[:osfamily] - when 'RedHat' - it_behaves_like 'networking-baremetal ml2 plugin' - when facts[:osfamily] != 'RedHat' - it 'fails with unsupported osfamily' do - should raise_error(Puppet::Error, /Unsupported osfamily.*/) - end - end + + it_behaves_like 'networking-baremetal ml2 plugin' end end end