Merge "magnum: Replace keypair_id by keypair_name"

This commit is contained in:
Zuul 2024-04-25 17:08:37 +00:00 committed by Gerrit Code Review
commit c4ffc0f8dc
3 changed files with 34 additions and 7 deletions

View File

@ -41,9 +41,9 @@
# (Optional) If ::tempest::magnum should configure the testing keypair
# Defaults to false (not yet supported, will be true when implemented)
#
# [*keypair_id*]
# [*keypair_name*]
# (Optional) The keypair_id parameter used in Magnum tempest configuration
# Defaults to 'default'
# Defaults to $facts['os_service_default']
#
# [*nic_id*]
# (Optional) The nic_id parameter used in Magnum tempest configuration
@ -65,6 +65,12 @@
# (Optional) Manage the plugin package
# Defaults to true
#
# DEPRECATED PARAMETERS
#
# [*keypair_id*]
# (Optional) The keypair_id parameter used in Magnum tempest configuration
# Defaults to undef
#
class tempest::magnum (
Stdlib::Absolutepath $tempest_config_file = '/var/lib/tempest/etc/tempest.conf',
Boolean $provision_image = true,
@ -75,15 +81,22 @@ class tempest::magnum (
String[1] $flavor_id = 's1.magnum',
String[1] $master_flavor_id = 'm1.magnum',
Boolean $provision_keypair = false,
$keypair_id = 'default',
$keypair_name = $facts['os_service_default'],
$nic_id = 'public',
$magnum_url = undef,
$copy_logs = true,
$dns_nameserver = '8.8.8.8',
Boolean $manage_tests_packages = true,
# DEPRECATED PARAMETERS
$keypair_id = undef,
) {
include tempest::params
if $keypair_id != undef {
warning("The keypair_id parameter is deprecated and has no effect. \
Use the keypair_name parameter.")
}
if $provision_image {
$image_properties = { 'os_distro' => $image_os_distro }
glance_image { $image_name:
@ -131,11 +144,16 @@ class tempest::magnum (
tempest_config {
'magnum/image_id': value => $image_name;
'magnum/nic_id': value => $nic_id;
'magnum/keypair_id': value => $keypair_id;
'magnum/keypair_name': value => $keypair_name;
'magnum/flavor_id': value => $flavor_id;
'magnum/master_flavor_id': value => $master_flavor_id;
'magnum/magnum_url': value => $magnum_url;
'magnum/copy_logs': value => $copy_logs;
'magnum/dns_nameserver': value => $dns_nameserver;
}
# TODO(tkajinam): Remove this after 2025.1
tempest_config {
'magnum/keypair_id': ensure => absent;
}
}

View File

@ -0,0 +1,9 @@
---
features:
- |
The new ``tempest::magnum::keypair_name`` parameter has been added.
deprecations:
- |
The new ``tempest::magnum::keypair_id`` parameter has been deprecated and
has no effect now.

View File

@ -18,7 +18,7 @@ describe 'tempest::magnum' do
is_expected.to contain_tempest_config('magnum/image_id').with_value('fedora-atomic-latest')
is_expected.to contain_tempest_config('magnum/nic_id').with_value('b2e6021a-4956-4a1f-8329-790b9add05a9')
is_expected.to contain_tempest_config('magnum/keypair_id').with_value('default')
is_expected.to contain_tempest_config('magnum/keypair_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tempest_config('magnum/flavor_id').with_value('s1.magnum')
is_expected.to contain_tempest_config('magnum/master_flavor_id').with_value('m1.magnum')
is_expected.to contain_tempest_config('magnum/copy_logs').with_value('true')
@ -34,7 +34,7 @@ describe 'tempest::magnum' do
:provision_flavors => false,
:flavor_id => 's1.tempest',
:master_flavor_id => 'm1.tempest',
:keypair_id => 'magnum',
:keypair_name => 'magnum',
:provision_keypair => false,
:magnum_url => 'http://magnum/',
:copy_logs => false,
@ -45,7 +45,7 @@ describe 'tempest::magnum' do
it 'configures tempest for magnum' do
is_expected.to contain_tempest_config('magnum/image_id').with_value('coreos')
is_expected.to contain_tempest_config('magnum/nic_id').with_value('b2e6021a-4956-4a1f-8329-790b9add05a9')
is_expected.to contain_tempest_config('magnum/keypair_id').with_value('magnum')
is_expected.to contain_tempest_config('magnum/keypair_name').with_value('magnum')
is_expected.to contain_tempest_config('magnum/flavor_id').with_value('s1.tempest')
is_expected.to contain_tempest_config('magnum/master_flavor_id').with_value('m1.tempest')
is_expected.to contain_tempest_config('magnum/magnum_url').with_value('http://magnum/')