Deprecate domain_id parameters

Currently we set both domain_name and domain_id for some configuration
files, but it makes it difficult for operators to use their original
domain because they should update both parameters correctly.

Because it's redundant to required both name and id set, this patch
deprecates all domain_id parameters, so that operator needs to set
their domain name, which is predictable, before creating actual domain.

Change-Id: Id96ab9af7ac5776d5a0000889d26e494c68d9376
This commit is contained in:
Takashi Kajinami 2020-04-21 16:29:57 +09:00
parent a641c9b051
commit dfeccd6749
8 changed files with 131 additions and 61 deletions

View File

@ -60,10 +60,6 @@
# (optional) Username for connection to ironic in admin context
# Defaults to 'ironic'
#
# [*project_domain_id*]
# (optional) Domain ID containing project
# Defaults to 'default'
#
# [*project_domain_name*]
# (Optional) Domain name containing project
# Defaults to 'Default'
@ -72,10 +68,6 @@
# (optional) Project name to scope to
# Defaults to 'services'
#
# [*user_domain_id*]
# (optional) User's domain ID for connection to ironic in admin context
# Defaults to 'default'
#
# [*user_domain_name*]
# (Optional) Name of domain for $username
# Defaults to 'Default'
@ -98,6 +90,16 @@
# ironic-neutron-agent config.
# Defaults to false.
#
# DEPRECATED PARAMETERS
#
# [*project_domain_id*]
# (optional) Domain ID containing project
# Defaults to undef
#
# [*user_domain_id*]
# (optional) User's domain ID for connection to ironic in admin context
# Defaults to undef
#
class neutron::agents::ml2::networking_baremetal (
$password,
$enabled = true,
@ -112,15 +114,16 @@ class neutron::agents::ml2::networking_baremetal (
$auth_type = 'password',
$auth_url = 'http://127.0.0.1:5000',
$username = 'ironic',
$project_domain_id = 'default',
$project_domain_name = 'Default',
$project_name = 'services',
$user_domain_id = 'default',
$user_domain_name = 'Default',
$region_name = $::os_service_default,
$retry_interval = $::os_service_default,
$max_retries = $::os_service_default,
$purge_config = false,
# DEPRECATED PARAMETERS
$project_domain_id = undef,
$user_domain_id = undef,
) {
include neutron::deps
@ -146,16 +149,30 @@ class neutron::agents::ml2::networking_baremetal (
'ironic/auth_url': value => $auth_url;
'ironic/username': value => $username;
'ironic/password': value => $password;
'ironic/project_domain_id': value => $project_domain_id;
'ironic/project_domain_name': value => $project_domain_name;
'ironic/project_name': value => $project_name;
'ironic/user_domain_id': value => $user_domain_id;
'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;
}
if $project_domain_id != undef {
warning('project_domain_id is deprecated and will be removed in a future release. \
Use project_domain_name instead')
ironic_neutron_agent_config {
'ironic/project_domain_id': value => $project_domain_id;
}
}
if $user_domain_id != undef {
warning('user_domain_id is deprecated and will be removed in a future release. \
Use user_domain_name instead')
ironic_neutron_agent_config {
'ironic/user_domain_id': value => $user_domain_id;
}
}
package { 'python2-ironic-neutron-agent':
ensure => $package_ensure,
name => $::neutron::params::networking_baremetal_agent_package,

View File

@ -27,18 +27,10 @@
# (optional) The name of the admin project
# Defaults to 'services'
#
# [*project_domain_id*]
# (optional) Nova project's domain ID
# Defaults to 'default'
#
# [*project_domain_name*]
# (Optional) Name of domain for $project_name
# Defaults to 'Default'
#
# [*user_domain_id*]
# (optional) User's domain ID for connection to designate in admin context
# Defaults to 'default'
#
# [*user_domain_name*]
# (Optional) Name of domain for $username
# Defaults to 'Default'
@ -61,6 +53,16 @@
# [*ptr_zone_email*]
# (optional) The email address to be used when creating PTR zones.
#
# DEPRECATED PARAMETERS
#
# [*project_domain_id*]
# (optional) Nova project's domain ID
# Defaults to undef
#
# [*user_domain_id*]
# (optional) User's domain ID for connection to designate in admin context
# Defaults to undef
#
class neutron::designate (
$password,
$url,
@ -68,15 +70,16 @@ class neutron::designate (
$username = 'neutron',
$project_id = $::os_service_default,
$project_name = 'services',
$project_domain_id = 'default',
$project_domain_name = 'Default',
$user_domain_id = 'default',
$user_domain_name = 'Default',
$auth_url = 'http://127.0.0.1:5000',
$allow_reverse_dns_lookup = $::os_service_default,
$ipv4_ptr_zone_prefix_size = $::os_service_default,
$ipv6_ptr_zone_prefix_size = $::os_service_default,
$ptr_zone_email = $::os_service_default,
# DEPRECATED PARAMETERS
$project_domain_id = undef,
$user_domain_id = undef,
) {
include neutron::deps
include neutron::params
@ -89,9 +92,7 @@ class neutron::designate (
'designate/username': value => $username;
'designate/project_id': value => $project_id;
'designate/project_name': value => $project_name;
'designate/project_domain_id': value => $project_domain_id;
'designate/project_domain_name': value => $project_domain_name;
'designate/user_domain_id': value => $user_domain_id;
'designate/user_domain_name': value => $user_domain_name;
'designate/auth_url': value => $auth_url;
'designate/allow_reverse_dns_lookup': value => $allow_reverse_dns_lookup;
@ -99,4 +100,20 @@ class neutron::designate (
'designate/ipv6_ptr_zone_prefix_size': value => $ipv6_ptr_zone_prefix_size;
'designate/ptr_zone_email': value => $ptr_zone_email;
}
if $project_domain_id != undef {
warning('project_domain_id is deprecated and will be removed in a future release. \
Use project_domain_name instead')
neutron_config {
'designate/project_domain_id': value => $project_domain_id;
}
}
if $user_domain_id != undef {
warning('user_domain_id is deprecated and will be removed in a future release. \
Use user_domain_name instead')
neutron_config {
'designate/user_domain_id': value => $user_domain_id;
}
}
}

View File

@ -42,10 +42,6 @@
# (optional) Username for connection to nova in admin context
# Defaults to 'nova'
#
# [*project_domain_id*]
# (optional) Nova project's domain ID
# Defaults to 'default'
#
# [*project_domain_name*]
# (Optional) Name of domain for $project_name
# Defaults to 'Default'
@ -54,10 +50,6 @@
# (optional) Nova project's name
# Defaults to 'services'
#
# [*user_domain_id*]
# (optional) User's domain ID for connection to nova in admin context
# Defaults to 'default'
#
# [*user_domain_name*]
# (Optional) Name of domain for $username
# Defaults to 'Default'
@ -89,6 +81,14 @@
# (optional) The name of the admin nova tenant
# Defaults to undef
#
# [*project_domain_id*]
# (optional) Nova project's domain ID
# Defaults to undef
#
# [*user_domain_id*]
# (optional) User's domain ID for connection to nova in admin context
# Defaults to undef
#
class neutron::server::notifications (
$password,
$notify_nova_on_port_status_changes = true,
@ -96,10 +96,8 @@ class neutron::server::notifications (
$send_events_interval = $::os_service_default,
$auth_type = 'password',
$username = 'nova',
$project_domain_id = 'default',
$project_domain_name = 'Default',
$project_name = 'services',
$user_domain_id = 'default',
$user_domain_name = 'Default',
$auth_url = 'http://127.0.0.1:5000',
$region_name = $::os_service_default,
@ -107,6 +105,8 @@ class neutron::server::notifications (
# DEPRECATED PARAMETERS
$tenant_id = undef,
$tenant_name = undef,
$project_domain_id = undef,
$user_domain_id = undef,
) {
include neutron::deps
@ -125,16 +125,30 @@ has no effect. Use neutron::server::notifications::project_name instead')
'nova/auth_url': value => $auth_url;
'nova/username': value => $username;
'nova/password': value => $password, secret => true;
'nova/project_domain_id': value => $project_domain_id;
'nova/project_domain_name': value => $project_domain_name;
'nova/project_name': value => $project_name;
'nova/user_domain_id': value => $user_domain_id;
'nova/user_domain_name': value => $user_domain_name;
'nova/region_name': value => $region_name;
'nova/endpoint_type': value => $endpoint_type;
'nova/auth_type': value => $auth_type;
}
if $project_domain_id != undef {
warning('project_domain_id is deprecated and will be removed in a future release. \
Use project_domain_name instead')
neutron_config {
'nova/project_domain_id': value => $project_domain_id;
}
}
if $user_domain_id != undef {
warning('user_domain_id is deprecated and will be removed in a future release. \
Use user_domain_name instead')
neutron_config {
'nova/user_domain_id': value => $user_domain_id;
}
}
neutron_config {
'DEFAULT/notify_nova_on_port_status_changes': value => $notify_nova_on_port_status_changes;
'DEFAULT/notify_nova_on_port_data_changes': value => $notify_nova_on_port_data_changes;

View File

@ -28,10 +28,6 @@
# (optional) Username for connection to nova in admin context
# Defaults to 'nova'
#
# [*project_domain_id*]
# (optional) Nova project's domain ID
# Defaults to 'default'
#
# [*project_domain_name*]
# (Optional) Name of domain for $project_name
# Defaults to 'Default'
@ -40,10 +36,6 @@
# (optional) Nova project's name
# Defaults to 'services'
#
# [*user_domain_id*]
# (optional) User's domain ID for connection to nova in admin context
# Defaults to 'default'
#
# [*user_domain_name*]
# (Optional) Name of domain for $username
# Defaults to 'Default'
@ -64,19 +56,29 @@
# the keystone catalog.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*project_domain_id*]
# (optional) Nova project's domain ID
# Defaults to undef
#
# [*user_domain_id*]
# (optional) User's domain ID for connection to nova in admin context
# Defaults to undef
#
class neutron::server::placement (
$password,
$auth_type = 'password',
$username = 'nova',
$project_domain_id = 'default',
$project_domain_name = 'Default',
$project_name = 'services',
$user_domain_id = 'default',
$user_domain_name = 'Default',
$auth_url = 'http://127.0.0.1:5000',
$region_name = $::os_service_default,
$endpoint_type = $::os_service_default,
# DEPRECATED PARAMETERS
$project_domain_id = undef,
$user_domain_id = undef,
) {
include neutron::deps
@ -85,14 +87,27 @@ class neutron::server::placement (
'placement/auth_url': value => $auth_url;
'placement/username': value => $username;
'placement/password': value => $password, secret => true;
'placement/project_domain_id': value => $project_domain_id;
'placement/project_domain_name': value => $project_domain_name;
'placement/project_name': value => $project_name;
'placement/user_domain_id': value => $user_domain_id;
'placement/user_domain_name': value => $user_domain_name;
'placement/region_name': value => $region_name;
'placement/endpoint_type': value => $endpoint_type;
'placement/auth_type': value => $auth_type;
}
if $project_domain_id != undef {
warning('project_domain_id is deprecated and will be removed in a future release. \
Use project_domain_name instead')
neutron_config {
'placement/project_domain_id': value => $project_domain_id;
}
}
if $user_domain_id != undef {
warning('user_domain_id is deprecated and will be removed in a future release. \
Use user_domain_name instead')
neutron_config {
'placement/user_domain_id': value => $user_domain_id;
}
}
}

View File

@ -0,0 +1,15 @@
---
features:
- |
The following parameters are now deprecated, and will be removed in a
future release. Please use project_domain_name and user_domain_name
instead.
- ``neutron::ml2::networking_baremetal::project_domain_id``
- ``neutron::ml2::networking_baremetal::user_domain_id``
- ``neutron::ml2::designate::project_domain_id``
- ``neutron::ml2::designate::user_domain_id``
- ``neutron::ml2::server::placement::project_domain_id``
- ``neutron::ml2::server::placement::user_domain_id``
- ``neutron::ml2::server::notifications::project_domain_id``
- ``neutron::ml2::server::notifications::user_domain_id``

View File

@ -9,10 +9,8 @@ describe 'neutron::agents::ml2::networking_baremetal' do
:auth_type => 'password',
:auth_url => 'http://127.0.0.1:5000',
:username => 'ironic',
:project_domain_id => 'default',
:project_domain_name => 'Default',
:project_name => 'services',
:user_domain_id => 'default',
:user_domain_name => 'Default',
:purge_config => false,
}
@ -47,10 +45,8 @@ describe 'neutron::agents::ml2::networking_baremetal' do
should contain_ironic_neutron_agent_config('ironic/auth_url').with_value(p[:auth_url])
should contain_ironic_neutron_agent_config('ironic/username').with_value(p[:username])
should contain_ironic_neutron_agent_config('ironic/password').with_value(p[:password])
should contain_ironic_neutron_agent_config('ironic/project_domain_id').with_value(p[:project_domain_id])
should contain_ironic_neutron_agent_config('ironic/project_domain_name').with_value(p[:project_domain_name])
should contain_ironic_neutron_agent_config('ironic/project_name').with_value(p[:project_name])
should contain_ironic_neutron_agent_config('ironic/user_domain_id').with_value(p[:user_domain_id])
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('<SERVICE DEFAULT>')
should contain_ironic_neutron_agent_config('ironic/retry_interval').with_value('<SERVICE DEFAULT>')

View File

@ -23,10 +23,8 @@ describe 'neutron::server::notifications' do
:auth_type => 'password',
:username => 'nova',
:password => 'secrete',
:project_domain_id => 'default',
:project_domain_name => 'Default',
:project_name => 'services',
:user_domain_id => 'default',
:user_domain_name => 'Default',
:auth_url => 'http://127.0.0.1:5000',
}
@ -43,9 +41,9 @@ describe 'neutron::server::notifications' do
should contain_neutron_config('nova/password').with_value('secrete')
should contain_neutron_config('nova/password').with_secret( true )
should contain_neutron_config('nova/region_name').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('nova/project_domain_id').with_value('default')
should_not contain_neutron_config('nova/project_domain_id')
should contain_neutron_config('nova/project_domain_name').with_value('Default')
should contain_neutron_config('nova/user_domain_id').with_value('default')
should_not contain_neutron_config('nova/user_domain_id')
should contain_neutron_config('nova/user_domain_name').with_value('Default')
should contain_neutron_config('nova/endpoint_type').with_value('<SERVICE DEFAULT>')
end

View File

@ -21,10 +21,8 @@ describe 'neutron::server::placement' do
:auth_type => 'password',
:username => 'nova',
:password => 'secrete',
:project_domain_id => 'default',
:project_domain_name => 'Default',
:project_name => 'services',
:user_domain_id => 'default',
:user_domain_name => 'Default',
:auth_url => 'http://127.0.0.1:5000',
}
@ -38,9 +36,9 @@ describe 'neutron::server::placement' do
should contain_neutron_config('placement/password').with_value('secrete')
should contain_neutron_config('placement/password').with_secret( true )
should contain_neutron_config('placement/region_name').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('placement/project_domain_id').with_value('default')
should_not contain_neutron_config('placement/project_domain_id')
should contain_neutron_config('placement/project_domain_name').with_value('Default')
should contain_neutron_config('placement/user_domain_id').with_value('default')
should_not contain_neutron_config('placement/user_domain_id')
should contain_neutron_config('placement/user_domain_name').with_value('Default')
should contain_neutron_config('placement/endpoint_type').with_value('<SERVICE DEFAULT>')
end