Remove faulty placement::config leftovers

Remove the leftover auth parameters in placement::config.

These are from the puppet-nova extraction and should not be
set in the placement section in placement's configuration file
since there is none.

This patch makes sure they are removed from the configuration
file to make sure deployments doesn't have auth config's laying
around that should not be there.

Change-Id: Ifacef570b2296b1b62c75d850c6059562ec4cb1c
This commit is contained in:
Tobias Urdin 2019-06-14 14:23:00 +02:00
parent 7339167498
commit 55b3d91ae9
3 changed files with 93 additions and 120 deletions

View File

@ -4,52 +4,8 @@
#
# === Parameters
#
# [*password*]
# (Required) Password for connecting to Nova Placement API service in
# admin context through the OpenStack Identity service.
#
# [*auth_type*]
# (Optional) Name of the auth type to load.
# Defaults to 'password'
#
# [*project_name*]
# (Optional) Project name for connecting to Nova Placement API service in
# admin context through the OpenStack Identity service.
# Defaults to 'services'
#
# [*project_domain_name*]
# (Optional) Project Domain name for connecting to Nova Placement API service in
# admin context through the OpenStack Identity service.
# Defaults to 'Default'
#
# [*user_domain_name*]
# (Optional) User Domain name for connecting to Nova Placement API service in
# admin context through the OpenStack Identity service.
# Defaults to 'Default'
#
# [*region_name*]
# (Optional) Region name for connecting to Nova Placement API service in admin context
# through the OpenStack Identity service.
# Defaults to 'RegionOne'
#
# [*valid_interfaces*]
# (Optional) Interface names used for getting the keystone endpoint for
# the placement API. Comma separated if multiple.
# Defaults to $::os_service_default
#
# [*username*]
# (Optional) Username for connecting to Nova Placement API service in admin context
# through the OpenStack Identity service.
# Defaults to 'placement'
#
# [*auth_url*]
# (Optional) Points to the OpenStack Identity server IP and port.
# This is the Identity (keystone) admin API server IP and port value,
# and not the Identity service API IP and port.
# Defaults to 'http://127.0.0.1:5000/v3'
#
# [*placement_config*]
# (optional) Allow configuration of arbitrary Placement configurations.
# (Optional) Allow configuration of arbitrary Placement configurations.
# The value is an hash of placement_config resources. Example:
# { 'DEFAULT/foo' => { value => 'fooValue'},
# 'DEFAULT/bar' => { value => 'barValue'}
@ -64,31 +20,80 @@
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
## DEPRECATED
#
# [*password*]
# (Optional) Password for connecting to Nova Placement API service in
# admin context through the OpenStack Identity service.
# Defaults to undef
#
# [*auth_type*]
# (Optional) Name of the auth type to load.
# Defaults to undef
#
# [*project_name*]
# (Optional) Project name for connecting to Nova Placement API service in
# admin context through the OpenStack Identity service.
# Defaults to undef
#
# [*project_domain_name*]
# (Optional) Project Domain name for connecting to Nova Placement API service in
# admin context through the OpenStack Identity service.
# Defaults to undef
#
# [*user_domain_name*]
# (Optional) User Domain name for connecting to Nova Placement API service in
# admin context through the OpenStack Identity service.
# Defaults to undef
#
# [*region_name*]
# (Optional) Region name for connecting to Nova Placement API service in admin context
# through the OpenStack Identity service.
# Defaults to undef
#
# [*valid_interfaces*]
# (Optional) Interface names used for getting the keystone endpoint for
# the placement API. Comma separated if multiple.
# Defaults to undef
#
# [*username*]
# (Optional) Username for connecting to Nova Placement API service in admin context
# through the OpenStack Identity service.
# Defaults to undef
#
# [*auth_url*]
# (Optional) Points to the OpenStack Identity server IP and port.
# This is the Identity (keystone) admin API server IP and port value,
# and not the Identity service API IP and port.
# Defaults to undef
#
class placement::config(
$password = false,
$auth_type = 'password',
$auth_url = 'http://127.0.0.1:5000/v3',
$region_name = 'RegionOne',
$valid_interfaces = $::os_service_default,
$project_domain_name = 'Default',
$project_name = 'services',
$user_domain_name = 'Default',
$username = 'placement',
$placement_config = {},
# DEPRECATED
$password = undef,
$auth_type = undef,
$auth_url = undef,
$region_name = undef,
$valid_interfaces = undef,
$project_domain_name = undef,
$project_name = undef,
$user_domain_name = undef,
$username = undef,
) {
include ::placement::deps
# TODO(tobias-urdin): Remove these deprecated ones in U release.
$default_parameters = {
'placement/auth_type' => { value => $auth_type},
'placement/auth_url' => { value => $auth_url},
'placement/password' => { value => $password, secret => true},
'placement/project_domain_name' => { value => $project_domain_name},
'placement/project_name' => { value => $project_name},
'placement/user_domain_name' => { value => $user_domain_name},
'placement/username' => { value => $username},
'placement/region_name' => { value => $region_name},
'placement/valid_interfaces' => { value => $valid_interfaces},
'placement/auth_type' => { ensure => 'absent' },
'placement/auth_url' => { ensure => 'absent' },
'placement/password' => { ensure => 'absent', secret => true },
'placement/project_domain_name' => { ensure => 'absent' },
'placement/project_name' => { ensure => 'absent' },
'placement/user_domain_name' => { ensure => 'absent' },
'placement/username' => { ensure => 'absent' },
'placement/region_name' => { ensure => 'absent' },
'placement/valid_interfaces' => { ensure => 'absent' },
}
validate_legacy(Hash, 'validate_hash', $default_parameters)
@ -96,5 +101,4 @@ class placement::config(
$placement_parameters = merge($default_parameters, $placement_config)
create_resources('placement_config', $placement_parameters)
}

View File

@ -0,0 +1,7 @@
---
deprecations:
- |
The parameters password, auth_type, auth_url, region_name, valid_interfaces,
project_domain_name, project_name, user_domain_name, username in placement::config
is deprecated and has no effect. They were leftovers from the puppet-nova extraction
and should not be set in the placement section of placement's configuration file.

View File

@ -3,74 +3,36 @@ require 'spec_helper'
describe 'placement::config' do
let :default_params do
{
:auth_type => 'password',
:project_name => 'services',
:project_domain_name => 'Default',
:region_name => 'RegionOne',
:username => 'placement',
:user_domain_name => 'Default',
:auth_url => 'http://127.0.0.1:5000/v3',
}
end
let :params do
{
:password => 's3cr3t',
:placement_config => {
'DEFAULT/foo' => { 'value' => 'fooValue' },
'DEFAULT/bar' => { 'value' => 'barValue' },
'DEFAULT/baz' => { 'ensure' => 'absent' }
}
:placement_config => {},
}
end
let :params do
{}
end
shared_examples 'placement::config' do
context 'with required parameters' do
context 'with default parameters' do
it { should contain_class('placement::deps') }
end
context 'when setting placement_config' do
before do
params.merge!(
:placement_config => {
'DEFAULT/foo' => { 'value' => 'fooValue' },
'DEFAULT/bar' => { 'value' => 'barValue' },
'DEFAULT/baz' => { 'ensure' => 'absent' }
}
)
end
it {
should contain_placement_config('placement/password').with_value(params[:password]).with_secret(true)
should contain_placement_config('placement/auth_type').with_value(default_params[:auth_type])
should contain_placement_config('placement/project_name').with_value(default_params[:project_name])
should contain_placement_config('placement/project_domain_name').with_value(default_params[:project_domain_name])
should contain_placement_config('placement/region_name').with_value(default_params[:region_name])
should contain_placement_config('placement/valid_interfaces').with_value('<SERVICE DEFAULT>')
should contain_placement_config('placement/username').with_value(default_params[:username])
should contain_placement_config('placement/user_domain_name').with_value(default_params[:user_domain_name])
should contain_placement_config('placement/auth_url').with_value(default_params[:auth_url])
should contain_placement_config('DEFAULT/foo').with_value('fooValue')
should contain_placement_config('DEFAULT/bar').with_value('barValue')
should contain_placement_config('DEFAULT/baz').with_ensure('absent')
}
end
context 'when overriding class parameters' do
before do
params.merge!(
:auth_type => 'password',
:project_name => 'service',
:project_domain_name => 'default',
:region_name => 'RegionTwo',
:valid_interfaces => 'internal',
:username => 'placement2',
:user_domain_name => 'default',
:auth_url => 'https://127.0.0.1:5000/v3',
)
end
it {
should contain_placement_config('placement/password').with_value(params[:password]).with_secret(true)
should contain_placement_config('placement/auth_type').with_value(params[:auth_type])
should contain_placement_config('placement/project_name').with_value(params[:project_name])
should contain_placement_config('placement/project_domain_name').with_value(params[:project_domain_name])
should contain_placement_config('placement/region_name').with_value(params[:region_name])
should contain_placement_config('placement/valid_interfaces').with_value(params[:valid_interfaces])
should contain_placement_config('placement/username').with_value(params[:username])
should contain_placement_config('placement/user_domain_name').with_value(params[:user_domain_name])
should contain_placement_config('placement/auth_url').with_value(params[:auth_url])
}
end
end
on_supported_os({