From 802da636e95a44663c272834cb43e4a4faf3c42d Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 18 Jun 2020 12:59:28 +0900 Subject: [PATCH] Update configuration for ovs integration bridge The DEFAULT/ovs_integration_bridge parameter was deprecated in neutron in favor of the new ovs/integration_bridge[1] parameter, so puppet-neutron should use the new parameter accordingly. Also, that parameter is also available in l3 agent configuration, so the new parameter, ovs_integration_bridge, was added to l3 agent manifest. [1] https://github.com/openstack/neutron/commit/33fb446add87a3427a246444b03befc46adb385d Change-Id: Ia558d97754aa3ad0bb00630b965b31e281c4b9f0 --- manifests/agents/dhcp.pp | 16 +++++++---- manifests/agents/l3.pp | 28 +++++++++++-------- manifests/server.pp | 8 +++++- ...n_bridge-to-l3-agent-7a3ba8654273434f.yaml | 6 ++++ spec/classes/neutron_agents_dhcp_spec.rb | 2 +- spec/classes/neutron_agents_l3_spec.rb | 10 +++++++ spec/classes/neutron_server_spec.rb | 4 +-- 7 files changed, 54 insertions(+), 20 deletions(-) create mode 100644 releasenotes/notes/add-ovs_integration_bridge-to-l3-agent-7a3ba8654273434f.yaml diff --git a/manifests/agents/dhcp.pp b/manifests/agents/dhcp.pp index d876b0f56..b21805056 100644 --- a/manifests/agents/dhcp.pp +++ b/manifests/agents/dhcp.pp @@ -163,10 +163,15 @@ class neutron::agents::dhcp ( 'DEFAULT/dnsmasq_dns_servers': value => join(any2array($dnsmasq_dns_servers), ','); 'DEFAULT/dnsmasq_local_resolv': value => $dnsmasq_local_resolv; 'DEFAULT/dnsmasq_enable_addr6_list': value => $dnsmasq_enable_addr6_list; - 'DEFAULT/ovs_integration_bridge': value => $ovs_integration_bridge; 'agent/availability_zone': value => $availability_zone; } + # DEFAULT/ovs_intergation_bridge was deprecated in favor of + # ovs/intergation_bridge. Make sure to purge the old parameter + neutron_dhcp_agent_config { + 'DEFAULT/ovs_integration_bridge': ensure => 'absent' + } + if $ovsdb_connection =~ /^ssl:/ { $req_ssl_opts = { 'ovsdb_agent_ssl_key_file' => $ovsdb_agent_ssl_key_file, @@ -183,10 +188,11 @@ class neutron::agents::dhcp ( } neutron_dhcp_agent_config { - 'OVS/ovsdb_connection': value => $ovsdb_connection; - 'OVS/ssl_key_file': value => $ovsdb_agent_ssl_key_file; - 'OVS/ssl_cert_file': value => $ovsdb_agent_ssl_cert_file; - 'OVS/ssl_ca_cert_file': value => $ovsdb_agent_ssl_ca_file; + 'OVS/ovsdb_connection': value => $ovsdb_connection; + 'OVS/integration_bridge': value => $ovs_integration_bridge; + 'OVS/ssl_key_file': value => $ovsdb_agent_ssl_key_file; + 'OVS/ssl_cert_file': value => $ovsdb_agent_ssl_cert_file; + 'OVS/ssl_ca_cert_file': value => $ovsdb_agent_ssl_ca_file; } if $::neutron::params::dhcp_agent_package { diff --git a/manifests/agents/l3.pp b/manifests/agents/l3.pp index 43fef4387..1795ca150 100644 --- a/manifests/agents/l3.pp +++ b/manifests/agents/l3.pp @@ -91,6 +91,10 @@ # will be passed. # Defaults to $::os_service_default # +# [*ovs_integration_bridge*] +# (optional) Name of Open vSwitch bridge to use +# Defaults to $::os_service_default +# # DEPRECATED PARAMETERS # # [*gateway_external_network_id*] @@ -117,6 +121,7 @@ class neutron::agents::l3 ( $availability_zone = $::os_service_default, $extensions = $::os_service_default, $radvd_user = $::os_service_default, + $ovs_integration_bridge = $::os_service_default, # DEPRECATED PARAMETERS $gateway_external_network_id = undef, ) { @@ -145,17 +150,18 @@ class neutron::agents::l3 ( } neutron_l3_agent_config { - 'DEFAULT/debug': value => $debug; - 'DEFAULT/interface_driver': value => $interface_driver; - 'DEFAULT/handle_internal_only_routers': value => $handle_internal_only_routers; - 'DEFAULT/metadata_port': value => $metadata_port; - 'DEFAULT/periodic_interval': value => $periodic_interval; - 'DEFAULT/periodic_fuzzy_delay': value => $periodic_fuzzy_delay; - 'DEFAULT/enable_metadata_proxy': value => $enable_metadata_proxy; - 'DEFAULT/agent_mode': value => $agent_mode; - 'DEFAULT/radvd_user': value => $radvd_user; - 'agent/availability_zone': value => $availability_zone; - 'agent/extensions': value => $extensions; + 'DEFAULT/debug': value => $debug; + 'DEFAULT/interface_driver': value => $interface_driver; + 'DEFAULT/handle_internal_only_routers': value => $handle_internal_only_routers; + 'DEFAULT/metadata_port': value => $metadata_port; + 'DEFAULT/periodic_interval': value => $periodic_interval; + 'DEFAULT/periodic_fuzzy_delay': value => $periodic_fuzzy_delay; + 'DEFAULT/enable_metadata_proxy': value => $enable_metadata_proxy; + 'DEFAULT/agent_mode': value => $agent_mode; + 'DEFAULT/radvd_user': value => $radvd_user; + 'ovs/integration_bridge': value => $ovs_integration_bridge; + 'agent/availability_zone': value => $availability_zone; + 'agent/extensions': value => $extensions; } if $::neutron::params::l3_agent_package { diff --git a/manifests/server.pp b/manifests/server.pp index 915b8fee0..dc8fdea5a 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -404,11 +404,17 @@ class neutron::server ( 'DEFAULT/dhcp_load_type': value => $dhcp_load_type; 'DEFAULT/default_availability_zones': value => join(any2array($default_availability_zones), ','); 'DEFAULT/network_auto_schedule': value => $network_auto_schedule; - 'DEFAULT/ovs_integration_bridge': value => $ovs_integration_bridge; + 'ovs/integration_bridge': value => $ovs_integration_bridge; 'service_providers/service_provider': value => $service_providers; 'ovs/igmp_snooping_enable': value => $igmp_snooping_enable; } + # DEFAULT/ovs_intergation_bridge was deprecated in favor of + # ovs/intergation_bridge. Make sure to purge the old parameter + neutron_config { + 'DEFAULT/ovs_integration_bridge': ensure => 'absent' + } + if $server_package { package { 'neutron-server': ensure => $package_ensure, diff --git a/releasenotes/notes/add-ovs_integration_bridge-to-l3-agent-7a3ba8654273434f.yaml b/releasenotes/notes/add-ovs_integration_bridge-to-l3-agent-7a3ba8654273434f.yaml new file mode 100644 index 000000000..ca645f9b7 --- /dev/null +++ b/releasenotes/notes/add-ovs_integration_bridge-to-l3-agent-7a3ba8654273434f.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + The new ``neutron::agent::l3::ovs_integration_bridge`` parameter was added + so that operators can set customized integration bridge name in l3 agent + configuration. diff --git a/spec/classes/neutron_agents_dhcp_spec.rb b/spec/classes/neutron_agents_dhcp_spec.rb index 6c1a56b00..9d95681fb 100644 --- a/spec/classes/neutron_agents_dhcp_spec.rb +++ b/spec/classes/neutron_agents_dhcp_spec.rb @@ -41,11 +41,11 @@ describe 'neutron::agents::dhcp' do should contain_neutron_dhcp_agent_config('DEFAULT/force_metadata').with_value(''); should contain_neutron_dhcp_agent_config('DEFAULT/enable_metadata_network').with_value(p[:enable_metadata_network]); should contain_neutron_dhcp_agent_config('DEFAULT/dhcp_broadcast_reply').with_value(''); - should contain_neutron_dhcp_agent_config('DEFAULT/ovs_integration_bridge').with_value(''); should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_local_resolv').with_value(''); should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_enable_addr6_list').with_value(''); should contain_neutron_dhcp_agent_config('agent/availability_zone').with_value(''); should contain_neutron_dhcp_agent_config('OVS/ovsdb_connection').with_value(''); + should contain_neutron_dhcp_agent_config('OVS/integration_bridge').with_value(''); should contain_neutron_dhcp_agent_config('OVS/ssl_key_file').with_value(''); should contain_neutron_dhcp_agent_config('OVS/ssl_cert_file').with_value(''); should contain_neutron_dhcp_agent_config('OVS/ssl_ca_cert_file').with_value(''); diff --git a/spec/classes/neutron_agents_l3_spec.rb b/spec/classes/neutron_agents_l3_spec.rb index 382c70169..04113797d 100644 --- a/spec/classes/neutron_agents_l3_spec.rb +++ b/spec/classes/neutron_agents_l3_spec.rb @@ -38,6 +38,7 @@ describe 'neutron::agents::l3' do should contain_neutron_l3_agent_config('DEFAULT/periodic_fuzzy_delay').with_value('') should contain_neutron_l3_agent_config('DEFAULT/enable_metadata_proxy').with_value('') should contain_neutron_l3_agent_config('DEFAULT/radvd_user').with_value('') + should contain_neutron_l3_agent_config('ovs/integration_bridge').with_value('') should contain_neutron_l3_agent_config('agent/availability_zone').with_value('') should contain_neutron_l3_agent_config('agent/extensions').with_value('') end @@ -110,6 +111,15 @@ describe 'neutron::agents::l3' do end end + context 'with ovs_integration_bridge' do + before :each do + params.merge!(:ovs_integration_bridge => 'br-int') + end + it 'should configure ovs_integration_bridge' do + should contain_neutron_l3_agent_config('ovs/integration_bridge').with_value(p[:ovs_integration_bridge]) + end + end + context 'with availability zone' do before :each do params.merge!(:availability_zone => 'zone1') diff --git a/spec/classes/neutron_server_spec.rb b/spec/classes/neutron_server_spec.rb index 1500de8a6..51ab905b2 100644 --- a/spec/classes/neutron_server_spec.rb +++ b/spec/classes/neutron_server_spec.rb @@ -69,7 +69,7 @@ describe 'neutron::server' do :enable_proxy_headers_parsing => '', :max_request_body_size => '', ) - should contain_neutron_config('DEFAULT/ovs_integration_bridge').with_value('') + should contain_neutron_config('ovs/integration_bridge').with_value('') should contain_neutron_config('ovs/igmp_snooping_enable').with_value('') end @@ -259,7 +259,7 @@ describe 'neutron::server' do params.merge!({:ovs_integration_bridge => 'br-int' }) end - it { should contain_neutron_config('DEFAULT/ovs_integration_bridge').with_value('br-int') } + it { should contain_neutron_config('ovs/integration_bridge').with_value('br-int') } end context 'with IGMP snooping enabled' do