Add support for volume options

This introduces a few new parameters to customize volume creation for
database instances.

Depends-on: https://review.opendev.org/c/openstack/trove/+/823164
Change-Id: Ie5b862422567083802a86fabeee11d5c80b8f396
This commit is contained in:
Takashi Kajinami 2023-12-27 10:44:15 +09:00
parent 4c87eadbd3
commit 0a832b7a06
3 changed files with 40 additions and 0 deletions

View File

@ -272,6 +272,18 @@
# (optional) The network that trove will attach by default.
# Defaults to $facts['os_service_default'].
#
# [*trove_volume_support*]
# (optional) Whether to provision a Cinder volume for datadir.
# Defaults to $facts['os_service_default'].
#
# [*volume_rootdisk_support*]
# (optional) Whether to provision a Cinder volume for rootdisk.
# Defaults to $facts['os_service_default'].
#
# [*volume_rootdisk_size*]
# (optional) Size of volume rootdisk for Database instance.
# Defaults to $facts['os_service_default'].
#
# [*package_ensure*]
# (optional) The state of the package.
# Defaults to 'present'
@ -333,6 +345,9 @@ class trove(
$trove_endpoint_type = $facts['os_service_default'],
$neutron_endpoint_type = $facts['os_service_default'],
$management_networks = $facts['os_service_default'],
$trove_volume_support = $facts['os_service_default'],
$volume_rootdisk_support = $facts['os_service_default'],
$volume_rootdisk_size = $facts['os_service_default'],
$package_ensure = 'present',
) {
@ -389,12 +404,20 @@ class trove(
}
}
# network
trove_config {
'DEFAULT/network_label_regex': value => '.*';
'DEFAULT/network_driver': value => 'trove.network.neutron.NeutronDriver';
'DEFAULT/management_networks': value => join(any2array($management_networks), ',');
}
# volume
trove_config {
'DEFAULT/trove_volume_support': value => $trove_volume_support;
'DEFAULT/volume_rootdisk_support': value => $volume_rootdisk_support;
'DEFAULT/volume_rootdisk_size': value => $volume_rootdisk_size;
}
oslo::messaging::default { 'trove_config':
transport_url => $default_transport_url,
control_exchange => $control_exchange,

View File

@ -0,0 +1,8 @@
---
features:
- |
The following parameters have been added to the ``trove`` class.
- ``trove_volume_support``
- ``volume_rootdisk_support``
- ``volume_rootdisk_size``

View File

@ -44,6 +44,9 @@ describe 'trove' do
is_expected.to contain_trove_config('DEFAULT/neutron_endpoint_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/glance_endpoint_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/management_networks').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/trove_volume_support').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/volume_rootdisk_support').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/volume_rootdisk_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/remote_nova_client').with_ensure('absent')
is_expected.to contain_trove_config('DEFAULT/remote_cinder_client').with_ensure('absent')
is_expected.to contain_trove_config('DEFAULT/remote_neutron_client').with_ensure('absent')
@ -120,6 +123,9 @@ describe 'trove' do
:swift_service_type => 'object-store',
:neutron_service_type => 'network',
:glance_service_type => 'image',
:trove_volume_support => true,
:volume_rootdisk_support => true,
:volume_rootdisk_size => 10,
}
end
@ -134,6 +140,9 @@ describe 'trove' do
is_expected.to contain_trove_config('DEFAULT/swift_service_type').with_value('object-store')
is_expected.to contain_trove_config('DEFAULT/neutron_service_type').with_value('network')
is_expected.to contain_trove_config('DEFAULT/glance_service_type').with_value('image')
is_expected.to contain_trove_config('DEFAULT/trove_volume_support').with_value(true)
is_expected.to contain_trove_config('DEFAULT/volume_rootdisk_support').with_value(true)
is_expected.to contain_trove_config('DEFAULT/volume_rootdisk_size').with_value(10)
end
end