Support [DEFAULT] swift_endpoint_type used by guestagent

... so that users can customize the consistent set of parameters used
by endpoint detection.

Change-Id: If883afff8c3218df6209b5d972fd414cd76033ed
This commit is contained in:
Takashi Kajinami 2025-01-11 23:15:24 +09:00
parent 373ce3188d
commit 9dbd291360
3 changed files with 16 additions and 3 deletions

View File

@ -47,6 +47,10 @@
# (optional) Service type to use when searching catalog
# Defaults to $facts['os_service_default'].
#
# [*swift_endpoint_type*]
# (optional) Service endpoint type to use when searching catalog.
# Defaults to $facts['os_service_default']
#
# [*default_transport_url*]
# (optional) A URL representing the messaging driver to use and its full
# configuration. Transport URLs take the form:
@ -121,6 +125,7 @@ class trove::guestagent(
$log_facility = $facts['os_service_default'],
$swift_url = $facts['os_service_default'],
$swift_service_type = $facts['os_service_default'],
$swift_endpoint_type = $facts['os_service_default'],
$default_transport_url = $::trove::default_transport_url,
$rabbit_use_ssl = $::trove::rabbit_use_ssl,
$root_grant = $facts['os_service_default'],
@ -150,6 +155,7 @@ class trove::guestagent(
trove_guestagent_config {
'DEFAULT/swift_url': value => $swift_url;
'DEFAULT/swift_service_type': value => $swift_service_type;
'DEFAULT/swift_endpoint_type': value => $swift_endpoint_type;
'DEFAULT/root_grant': value => $root_grant;
'DEFAULT/root_grant_option': value => $root_grant_option;
'DEFAULT/default_password_length': value => pick($default_password_length, $facts['os_service_default']);

View File

@ -0,0 +1,4 @@
---
features:
- |
The ``trove::guestagent::swift_endpoint_type`` parameter has been added.

View File

@ -63,6 +63,7 @@ describe 'trove::guestagent' do
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_service_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_endpoint_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/root_grant').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/root_grant_option').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/default_password_length').with_value('<SERVICE DEFAULT>')
@ -139,14 +140,16 @@ describe 'trove::guestagent' do
let :params do
{
:swift_url => 'http://10.0.0.1:8080/v1/AUTH_',
:swift_service_type => 'object-store',
:rabbit_use_ssl => 'true'
:swift_url => 'http://10.0.0.1:8080/v1/AUTH_',
:swift_service_type => 'object-store',
:swift_endpoint_type => 'publicURL',
:rabbit_use_ssl => 'true'
}
end
it 'configures trove-guestagent with custom parameters' do
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('http://10.0.0.1:8080/v1/AUTH_')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_service_type').with_value('object-store')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_endpoint_type').with_value('publicURL')
is_expected.to contain_oslo__messaging__rabbit('trove_guestagent_config').with(
:rabbit_use_ssl => 'true',
)