diff --git a/manifests/plugins/ml2.pp b/manifests/plugins/ml2.pp index 3c45673e9..2ddff7799 100644 --- a/manifests/plugins/ml2.pp +++ b/manifests/plugins/ml2.pp @@ -59,14 +59,14 @@ # well as ranges of VLAN tags on each available for # allocation to tenant networks. # Should be an array with vlan_min = 1 & vlan_max = 4094 (IEEE 802.1Q) -# Default to empty. +# Default to 'physnet1:1000:2999'. # # [*tunnel_id_ranges*] # (optional) Comma-separated list of : tuples # enumerating ranges of GRE tunnel IDs that are # available for tenant network allocation # Should be an array with tun_max +1 - tun_min > 1000000 -# Default to empty. +# Default to '20:100'. # # [*vxlan_group*] # (optional) Multicast group for VXLAN. @@ -74,14 +74,14 @@ # broadcast traffic to this multicast group. When left unconfigured, will # disable multicast VXLAN mode # Should be an Multicast IP (v4 or v6) address. -# Default to 'None'. +# Default to '224.0.0.1'. # # [*vni_ranges*] # (optional) Comma-separated list of : tuples # enumerating ranges of VXLAN VNI IDs that are # available for tenant network allocation. # Min value is 0 and Max value is 16777215. -# Default to empty. +# Default to '10:100'. # # [*enable_security_group*] # (optional) Controls if neutron security group is enabled or not. @@ -120,11 +120,11 @@ class neutron::plugins::ml2 ( $type_drivers = ['local', 'flat', 'vlan', 'gre', 'vxlan'], $tenant_network_types = ['local', 'flat', 'vlan', 'gre', 'vxlan'], $mechanism_drivers = ['openvswitch', 'linuxbridge'], - $flat_networks = ['*'], - $network_vlan_ranges = ['physnet1:1000:2999'], - $tunnel_id_ranges = ['20:100'], + $flat_networks = '*', + $network_vlan_ranges = 'physnet1:1000:2999', + $tunnel_id_ranges = '20:100', $vxlan_group = '224.0.0.1', - $vni_ranges = ['10:100'], + $vni_ranges = '10:100', $enable_security_group = true, $package_ensure = 'present', $supported_pci_vendor_devs = ['15b3:1004', '8086:10ca'], @@ -137,7 +137,6 @@ class neutron::plugins::ml2 ( Neutron_plugin_ml2<||> ~> Service<| title == 'neutron-server' |> - validate_array($mechanism_drivers) if ! $mechanism_drivers { warning('Without networking mechanism driver, ml2 will not communicate with L2 agents') } @@ -195,9 +194,9 @@ class neutron::plugins::ml2 ( } neutron_plugin_ml2 { - 'ml2/type_drivers': value => join($type_drivers, ','); - 'ml2/tenant_network_types': value => join($tenant_network_types, ','); - 'ml2/mechanism_drivers': value => join($mechanism_drivers, ','); + 'ml2/type_drivers': value => join(any2array($type_drivers), ','); + 'ml2/tenant_network_types': value => join(any2array($tenant_network_types), ','); + 'ml2/mechanism_drivers': value => join(any2array($mechanism_drivers), ','); 'ml2/path_mtu': value => $path_mtu; 'securitygroup/enable_security_group': value => $enable_security_group; } @@ -211,8 +210,5 @@ class neutron::plugins::ml2 ( neutron_plugin_ml2 { 'ml2/physical_network_mtus': value => join($physical_network_mtus, ','); } - } - - Neutron_plugin_ml2<||> ~> Exec<| title == 'neutron-db-sync' |> - + } Neutron_plugin_ml2<||> ~> Exec<| title == 'neutron-db-sync' |> } diff --git a/manifests/plugins/ml2/mech_driver.pp b/manifests/plugins/ml2/mech_driver.pp index 8a374c3f5..3e63cbce6 100644 --- a/manifests/plugins/ml2/mech_driver.pp +++ b/manifests/plugins/ml2/mech_driver.pp @@ -32,7 +32,7 @@ define neutron::plugins::ml2::mech_driver ( ){ if ($name == 'sriovnicswitch') { neutron_plugin_ml2 { - 'ml2_sriov/supported_pci_vendor_devs': value => join($supported_pci_vendor_devs, ','); + 'ml2_sriov/supported_pci_vendor_devs': value => join(any2array($supported_pci_vendor_devs), ','); 'ml2_sriov/agent_required': value => $sriov_agent_required; } } diff --git a/manifests/plugins/ml2/type_driver.pp b/manifests/plugins/ml2/type_driver.pp index 34968a12d..913be7bda 100644 --- a/manifests/plugins/ml2/type_driver.pp +++ b/manifests/plugins/ml2/type_driver.pp @@ -48,7 +48,7 @@ define neutron::plugins::ml2::type_driver ( ){ if ($name == 'flat') { neutron_plugin_ml2 { - 'ml2_type_flat/flat_networks': value => join($flat_networks, ','); + 'ml2_type_flat/flat_networks': value => join(any2array($flat_networks), ','); } } elsif ($name == 'gre') { @@ -60,7 +60,7 @@ define neutron::plugins::ml2::type_driver ( validate_tunnel_id_ranges($tunnel_id_ranges) neutron_plugin_ml2 { - 'ml2_type_gre/tunnel_id_ranges': value => join($tunnel_id_ranges, ','); + 'ml2_type_gre/tunnel_id_ranges': value => join(any2array($tunnel_id_ranges), ','); } } elsif ($name == 'vlan') { @@ -72,7 +72,7 @@ define neutron::plugins::ml2::type_driver ( validate_network_vlan_ranges($network_vlan_ranges) neutron_plugin_ml2 { - 'ml2_type_vlan/network_vlan_ranges': value => join($network_vlan_ranges, ','); + 'ml2_type_vlan/network_vlan_ranges': value => join(any2array($network_vlan_ranges), ','); } } elsif ($name == 'vxlan') { @@ -98,7 +98,7 @@ define neutron::plugins::ml2::type_driver ( neutron_plugin_ml2 { 'ml2_type_vxlan/vxlan_group': value => $vxlan_group; - 'ml2_type_vxlan/vni_ranges': value => join($vni_ranges, ','); + 'ml2_type_vxlan/vni_ranges': value => join(any2array($vni_ranges), ','); } } elsif ($name == 'local') { diff --git a/spec/classes/neutron_plugins_ml2_spec.rb b/spec/classes/neutron_plugins_ml2_spec.rb index ca8ea5232..0f090f50d 100644 --- a/spec/classes/neutron_plugins_ml2_spec.rb +++ b/spec/classes/neutron_plugins_ml2_spec.rb @@ -32,11 +32,11 @@ describe 'neutron::plugins::ml2' do { :type_drivers => ['local', 'flat', 'vlan', 'gre', 'vxlan'], :tenant_network_types => ['local', 'flat', 'vlan', 'gre', 'vxlan'], :mechanism_drivers => ['openvswitch', 'linuxbridge'], - :flat_networks => ['*'], - :network_vlan_ranges => ['10:50'], - :tunnel_id_ranges => ['20:100'], + :flat_networks => '*', + :network_vlan_ranges => '10:50', + :tunnel_id_ranges => '20:100', :vxlan_group => '224.0.0.1', - :vni_ranges => ['10:100'], + :vni_ranges => '10:100', :path_mtu => '0', :physical_network_mtus => '', :package_ensure => 'present' }