From 41ce833c7345567b1411331c718625b15d24f488 Mon Sep 17 00:00:00 2001 From: Tom Barron Date: Mon, 30 Oct 2017 17:02:36 -0400 Subject: [PATCH] Add support for address family parameters in the network plugins. Support for these in manila itself was added in Pike [1]. [1] I96d3389262e9829b8b4344870cdf5c76abd22828 Needed-By: Ia895d7190f0fb8e97c87b3178461d9fc26393b9b Change-Id: Ic7e5b5351e429755ba48613ab89d1b7e7d6e2d34 --- manifests/network/neutron.pp | 11 +++++++++++ manifests/network/neutron_single_network.pp | 17 ++++++++++++++--- manifests/network/standalone.pp | 10 ++++++++++ ...addr_family_parameters-7cca69252e71083f.yaml | 6 ++++++ spec/classes/manila_network_neutron_spec.rb | 5 +++++ ...anila_network_neutron_single_network_spec.rb | 6 ++++-- 6 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/add_network_plugin_addr_family_parameters-7cca69252e71083f.yaml diff --git a/manifests/network/neutron.pp b/manifests/network/neutron.pp index 6ff81579..81888e79 100644 --- a/manifests/network/neutron.pp +++ b/manifests/network/neutron.pp @@ -36,6 +36,13 @@ # (optional) Location of ca certificates file to use for # neutron client requests. # +# [*network_plugin_ipv4_enabled*] +# (optional) Whether to support Ipv4 network resource +# +# [*network_plugin_ipv6_enabled*] +# (optional) whether to support IPv6 network resource +# + class manila::network::neutron ( $neutron_url = 'http://127.0.0.1:9696', $neutron_url_timeout = 30, @@ -47,6 +54,8 @@ class manila::network::neutron ( $neutron_api_insecure = false, $neutron_auth_strategy = 'keystone', $neutron_ca_certificates_file = undef, + $network_plugin_ipv4_enabled = $::os_service_default, + $network_plugin_ipv6_enabled = $::os_service_default, ) { $neutron_plugin_name = 'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin' @@ -63,5 +72,7 @@ class manila::network::neutron ( 'DEFAULT/neutron_api_insecure': value => $neutron_api_insecure; 'DEFAULT/neutron_auth_strategy': value => $neutron_auth_strategy; 'DEFAULT/neutron_ca_certificates_file': value => $neutron_ca_certificates_file; + 'DEFAULT/network_plugin_ipv4_enabled': value => $network_plugin_ipv4_enabled; + 'DEFAULT/network_plugin_ipv6_enabled': value => $network_plugin_ipv6_enabled; } } diff --git a/manifests/network/neutron_single_network.pp b/manifests/network/neutron_single_network.pp index e7616307..4cd01039 100644 --- a/manifests/network/neutron_single_network.pp +++ b/manifests/network/neutron_single_network.pp @@ -15,17 +15,28 @@ # 'neutron_net_id'. This opt is used only with # class 'NeutronSingleNetworkPlugin'. # +# [*network_plugin_ipv4_enabled*] +# (optional) Whether to support Ipv4 network resource +# +# [*network_plugin_ipv6_enabled*] +# (optional) whether to support IPv6 network resource +# define manila::network::neutron_single_network ( $neutron_net_id, $neutron_subnet_id, + $network_plugin_ipv4_enabled, + $network_plugin_ipv6_enabled, ) { $neutron_single_plugin_name = 'manila.network.neutron.neutron_network_plugin.NeutronSingleNetworkPlugin' manila_config { - "${name}/network_api_class": value => $neutron_single_plugin_name; - "${name}/neutron_net_id": value => $neutron_net_id; - "${name}/neutron_subnet_id": value => $neutron_subnet_id; + "${name}/network_api_class": value => $neutron_single_plugin_name; + "${name}/neutron_net_id": value => $neutron_net_id; + "${name}/neutron_subnet_id": value => $neutron_subnet_id; + "${name}/network_plugin_ipv4_enabled": value => $network_plugin_ipv4_enabled; + "${name}/network_plugin_ipv6_enabled": value => $network_plugin_ipv6_enabled; + } } diff --git a/manifests/network/standalone.pp b/manifests/network/standalone.pp index e44d740a..37a26aae 100644 --- a/manifests/network/standalone.pp +++ b/manifests/network/standalone.pp @@ -25,6 +25,12 @@ # Examples: 10.0.0.10 or 10.0.0.10-10.0.0.20 or # 10.0.0.10-10.0.0.20,10.0.0.30-10.0.0.40,10.0.0.50 # +# [*network_plugin_ipv4_enabled*] +# (optional) Whether to support Ipv4 network resource +# +# [*network_plugin_ipv6_enabled*] +# (optional) whether to support IPv6 network resource +# # DEPRECATED PARAMETERS # # [*standalone_network_plugin_ip_version*] @@ -37,6 +43,8 @@ define manila::network::standalone ( $standalone_network_plugin_mask, $standalone_network_plugin_segmentation_id = undef, $standalone_network_plugin_allowed_ip_ranges = undef, + $network_plugin_ipv4_enabled = $::os_service_default, + $network_plugin_ipv6_enabled = $::os_service_default, # DEPRECATED PARAMETERS $standalone_network_plugin_ip_version = undef, ) { @@ -53,6 +61,8 @@ define manila::network::standalone ( "${name}/standalone_network_plugin_mask": value => $standalone_network_plugin_mask; "${name}/standalone_network_plugin_segmentation_id": value => $standalone_network_plugin_segmentation_id; "${name}/standalone_network_plugin_allowed_ip_ranges": value => $standalone_network_plugin_allowed_ip_ranges; + 'DEFAULT/network_plugin_ipv4_enabled': value => $network_plugin_ipv4_enabled; + 'DEFAULT/network_plugin_ipv6_enabled': value => $network_plugin_ipv6_enabled; } } diff --git a/releasenotes/notes/add_network_plugin_addr_family_parameters-7cca69252e71083f.yaml b/releasenotes/notes/add_network_plugin_addr_family_parameters-7cca69252e71083f.yaml new file mode 100644 index 00000000..abef7595 --- /dev/null +++ b/releasenotes/notes/add_network_plugin_addr_family_parameters-7cca69252e71083f.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + In Pike manila proper added IPv6 support for network plugins and drivers + so we now support the configuration parameters ``network_plugin_ipv4_enabled`` + and ``network_plugin_ipv6_enabled``. diff --git a/spec/classes/manila_network_neutron_spec.rb b/spec/classes/manila_network_neutron_spec.rb index 727b74da..51b778af 100644 --- a/spec/classes/manila_network_neutron_spec.rb +++ b/spec/classes/manila_network_neutron_spec.rb @@ -20,9 +20,14 @@ describe 'manila::network::neutron' do :neutron_admin_auth_url => 'http://localhost:5000/v2.0', :neutron_api_insecure => false, :neutron_auth_strategy => 'keystone', + :network_plugin_ipv4_enabled => '', + :network_plugin_ipv6_enabled => '', } end + let :facts do + OSDefaults.get_facts({}) + end shared_examples_for 'neutron network plugin' do let :params_hash do diff --git a/spec/defines/manila_network_neutron_single_network_spec.rb b/spec/defines/manila_network_neutron_single_network_spec.rb index c57a0b0e..ebad77e1 100644 --- a/spec/defines/manila_network_neutron_single_network_spec.rb +++ b/spec/defines/manila_network_neutron_single_network_spec.rb @@ -5,8 +5,10 @@ describe 'manila::network::neutron_single_network' do let :params do { - :neutron_net_id => 'abcdef', - :neutron_subnet_id => 'ghijkl', + :neutron_net_id => 'abcdef', + :neutron_subnet_id => 'ghijkl', + :network_plugin_ipv4_enabled => '', + :network_plugin_ipv6_enabled => '', } end