From 09429d0ebc6bff6aed5808faf7c4430e72d2dafb Mon Sep 17 00:00:00 2001 From: ramishra Date: Tue, 15 Jun 2021 08:44:54 +0530 Subject: [PATCH] Update networking-baremetal parameters Auth parameters in networking-baremetal has been updated by [1]. This change updates parameters in puppet-neutron according to the change. [1] a4e75f839605f6e2aba6b5f658004e9ffabc7156 Change-Id: I545f467d50b5eebbae26a6fd9e9fb7b35f8b84f8 --- manifests/agents/ml2/networking_baremetal.pp | 140 ++++++++++++------ .../notes/openstacksdk-23a1334aadc64d02.yaml | 14 ++ ...on_agents_ml2_networking_baremetal_spec.rb | 7 +- 3 files changed, 111 insertions(+), 50 deletions(-) create mode 100644 releasenotes/notes/openstacksdk-23a1334aadc64d02.yaml diff --git a/manifests/agents/ml2/networking_baremetal.pp b/manifests/agents/ml2/networking_baremetal.pp index 7abb81b1d..269780d51 100644 --- a/manifests/agents/ml2/networking_baremetal.pp +++ b/manifests/agents/ml2/networking_baremetal.pp @@ -19,15 +19,6 @@ # (optional) Package ensure state. # Defaults to 'present'. # -# [*auth_strategy*] -# (optional) Method to use for authentication: noauth or keystone. -# Defaults to $::os_service_default -# -# [*ironic_url*] -# (optional) Ironic API URL, used to set Ironic API URL when auth_strategy -# option is noauth to work with standalone Ironic without keystone. -# Defaults to $::os_service_default -# # [*cafile*] # (optional) PEM encoded Certificate Authority to use when verifying HTTPs # connections. @@ -56,6 +47,10 @@ # determined using auth_url # Defaults to 'http://127.0.0.1:5000' # +# [*endpoint_override*] +# (optional) The ironic endpoint URL for requests +# Defaults to $::os_service_default +# # [*username*] # (optional) Username for connection to ironic in admin context # Defaults to 'ironic' @@ -77,11 +72,11 @@ # region. # Defaults to $::os_service_default # -# [*retry_interval*] +# [*status_code_retry_delay*] # (optional) Interval between retries in case of conflict error (HTTP 409). # Defaults to $::os_service_default # -# [*max_retries*] +# [*status_code_retries*] # (optional) Maximum number of retries in case of conflict error (HTTP 409). # Defaults to $::os_service_default # @@ -90,27 +85,50 @@ # ironic-neutron-agent config. # Defaults to false. # +# DEPRECATED PARAMETERS +# +# [*auth_strategy*] +# (optional) Method to use for authentication: noauth or keystone. +# Defaults to undef +# +# [*ironic_url*] +# (optional) Ironic API URL, used to set Ironic API URL when auth_strategy +# option is noauth to work with standalone Ironic without keystone. +# Defaults to undef +# +# [*retry_interval*] +# (optional) Interval between retries in case of conflict error (HTTP 409). +# Defaults to undef +# +# [*max_retries*] +# (optional) Maximum number of retries in case of conflict error (HTTP 409). +# Defaults to undef +# class neutron::agents::ml2::networking_baremetal ( $password, - $enabled = true, - $manage_service = true, - $package_ensure = 'present', - $auth_strategy = $::os_service_default, - $ironic_url = $::os_service_default, - $cafile = $::os_service_default, - $certfile = $::os_service_default, - $keyfile = $::os_service_default, - $insecure = $::os_service_default, - $auth_type = 'password', - $auth_url = 'http://127.0.0.1:5000', - $username = 'ironic', - $project_domain_name = 'Default', - $project_name = 'services', - $user_domain_name = 'Default', - $region_name = $::os_service_default, - $retry_interval = $::os_service_default, - $max_retries = $::os_service_default, - $purge_config = false, + $enabled = true, + $manage_service = true, + $package_ensure = 'present', + $endpoint_override = $::os_service_default, + $cafile = $::os_service_default, + $certfile = $::os_service_default, + $keyfile = $::os_service_default, + $insecure = $::os_service_default, + $auth_type = 'password', + $auth_url = 'http://127.0.0.1:5000', + $username = 'ironic', + $project_domain_name = 'Default', + $project_name = 'services', + $user_domain_name = 'Default', + $region_name = $::os_service_default, + $status_code_retry_delay = $::os_service_default, + $status_code_retries = $::os_service_default, + $purge_config = false, + # DEPRECATED PARAMETERS + $auth_strategy = undef, + $ironic_url = undef, + $retry_interval = undef, + $max_retries = undef, ) { include neutron::deps @@ -125,23 +143,53 @@ class neutron::agents::ml2::networking_baremetal ( purge => $purge_config, } + if $auth_strategy != undef { + warn('neutron::agents::ml2::networking_baremetal::auth_strategy is now deprecated \ +and has no effect.') + } + + if $ironic_url != undef { + warn('neutron::agents::ml2::networking_baremetal::ironic_url is now deprecated. \ +Use endpoint_override instead.') + } + + if $retry_interval != undef { + warn('neutron::agents::ml2::networking_baremetal::retry_interval is now deprecated. \ +Use status_code_retry_delay instead.') + } + + if $max_retries != undef { + warn('neutron::agents::ml2::networking_baremetal::max_retries is now deprecated. \ +Use status_code_retries instead.') + } + ironic_neutron_agent_config { - 'ironic/auth_strategy': value => $auth_strategy; - 'ironic/ironic_url': value => $ironic_url; - 'ironic/cafile': value => $cafile; - 'ironic/certfile': value => $certfile; - 'ironic/keyfile': value => $keyfile; - 'ironic/insecure': value => $insecure; - 'ironic/auth_type': value => $auth_type; - 'ironic/auth_url': value => $auth_url; - 'ironic/username': value => $username; - 'ironic/password': value => $password, secret => true; - 'ironic/project_domain_name': value => $project_domain_name; - 'ironic/project_name': value => $project_name; - 'ironic/user_domain_name': value => $user_domain_name; - 'ironic/region_name': value => $region_name; - 'ironic/retry_interval': value => $retry_interval; - 'ironic/max_retries': value => $max_retries; + 'ironic/auth_strategy': ensure => absent; + 'ironic/ironic_url': ensure => absent; + 'ironic/retry_interval': ensure => absent; + 'ironic/max_retries': ensure => absent; + } + + $endpoint_override_real = pick($ironic_url, $endpoint_override) + $status_code_retry_delay_real = pick($retry_interval, $status_code_retry_delay) + $status_code_retries_real = pick($max_retries, $status_code_retries) + + ironic_neutron_agent_config { + 'ironic/endpoint_override': value => $endpoint_override_real; + 'ironic/cafile': value => $cafile; + 'ironic/certfile': value => $certfile; + 'ironic/keyfile': value => $keyfile; + 'ironic/insecure': value => $insecure; + 'ironic/auth_type': value => $auth_type; + 'ironic/auth_url': value => $auth_url; + 'ironic/username': value => $username; + 'ironic/password': value => $password, secret => true; + 'ironic/project_domain_name': value => $project_domain_name; + 'ironic/project_name': value => $project_name; + 'ironic/user_domain_name': value => $user_domain_name; + 'ironic/region_name': value => $region_name; + 'ironic/status_code_retry_delay': value => $status_code_retry_delay_real; + 'ironic/status_code_retries': value => $status_code_retries_real; } package { 'python-ironic-neutron-agent': diff --git a/releasenotes/notes/openstacksdk-23a1334aadc64d02.yaml b/releasenotes/notes/openstacksdk-23a1334aadc64d02.yaml new file mode 100644 index 000000000..c04f63158 --- /dev/null +++ b/releasenotes/notes/openstacksdk-23a1334aadc64d02.yaml @@ -0,0 +1,14 @@ +--- +deprecations: + - | + The ``neutron::agents::ml2::networking_baremetal::auth_strategy`` parameter + has been deprecated and has no effect. + + - | + The following parameters of ``neutron::agents::ml2::networking_baremetal`` + class have been renamed. Old parameters were deprecated and will be removed + in a future release. + + - ``ironic_url`` => ``endpoint_override`` + - ``retry_interval`` => ``status_code_retry_delay`` + - ``max_retries`` => ``status_code_retries`` diff --git a/spec/classes/neutron_agents_ml2_networking_baremetal_spec.rb b/spec/classes/neutron_agents_ml2_networking_baremetal_spec.rb index 36309a436..1d5c37efb 100644 --- a/spec/classes/neutron_agents_ml2_networking_baremetal_spec.rb +++ b/spec/classes/neutron_agents_ml2_networking_baremetal_spec.rb @@ -36,8 +36,7 @@ describe 'neutron::agents::ml2::networking_baremetal' do end it 'configures /etc/neutron/plugins/ml2/ironic_neutron_agent.ini' do - should contain_ironic_neutron_agent_config('ironic/auth_strategy').with_value('') - should contain_ironic_neutron_agent_config('ironic/ironic_url').with_value('') + should contain_ironic_neutron_agent_config('ironic/endpoint_override').with_value('') should contain_ironic_neutron_agent_config('ironic/cafile').with_value('') should contain_ironic_neutron_agent_config('ironic/certfile').with_value('') should contain_ironic_neutron_agent_config('ironic/keyfile').with_value('') @@ -49,8 +48,8 @@ describe 'neutron::agents::ml2::networking_baremetal' do should contain_ironic_neutron_agent_config('ironic/project_name').with_value(p[:project_name]) should contain_ironic_neutron_agent_config('ironic/user_domain_name').with_value(p[:user_domain_name]) should contain_ironic_neutron_agent_config('ironic/region_name').with_value('') - should contain_ironic_neutron_agent_config('ironic/retry_interval').with_value('') - should contain_ironic_neutron_agent_config('ironic/max_retries').with_value('') + should contain_ironic_neutron_agent_config('ironic/status_code_retry_delay').with_value('') + should contain_ironic_neutron_agent_config('ironic/status_code_retries').with_value('') end it 'installs ironic-neutron-agent agent package' do