Add nova::compute::flat_injected parameter

This adds a parameter to the nova::compute class
for the flat_injected configuration option.

Change-Id: Idb6b9ce7e21a96e8c63e1c2976e4088a307b1c25
This commit is contained in:
Tobias Urdin 2024-03-18 22:16:02 +01:00
parent d18827eca2
commit fb73d45b03
3 changed files with 26 additions and 4 deletions

View File

@ -54,10 +54,6 @@
# (optional) Whether to force the config drive to be attached to all VMs
# Defaults to false
#
# [*mkisofs_cmd*]
# (optional) Name or path of the tool used for ISO image creation.
# Defaults to $facts['os_service_default']
#
# [*instance_usage_audit*]
# (optional) Generate periodic compute.instance.exists notifications.
# Defaults to false
@ -67,6 +63,15 @@
# Time period must be hour, day, month or year with/without offset.
# Defaults to $facts['os_service_default']
#
# [*flat_injected*]
# (optional) This option determines whether the network setup information is
# injected into the VM before it is booted.
# Defaults to $facts['os_service_default']
#
# [*mkisofs_cmd*]
# (optional) Name or path of the tool used for ISO image creation.
# Defaults to $facts['os_service_default']
#
# [*use_cow_images*]
# (optional) Enable use of copy-on-write (cow) images.
# Defaults to $facts['os_service_default']
@ -271,6 +276,7 @@ class nova::compute (
Boolean $force_config_drive = false,
Boolean $instance_usage_audit = false,
$instance_usage_audit_period = $facts['os_service_default'],
$flat_injected = $facts['os_service_default'],
$mkisofs_cmd = $facts['os_service_default'],
$use_cow_images = $facts['os_service_default'],
$force_raw_images = $facts['os_service_default'],
@ -451,6 +457,8 @@ class nova::compute (
}
}
nova_config { 'DEFAULT/flat_injected': value => $flat_injected }
nova_config {
'DEFAULT/config_drive_format': value => pick($config_drive_format, $facts['os_service_default']);
}

View File

@ -0,0 +1,5 @@
---
features:
- |
Added new ``nova::compute::flat_injected`` boolean parameter to configure the
configuration option in Nova with the same name.

View File

@ -66,6 +66,7 @@ describe 'nova::compute' do
it { is_expected.to contain_nova_config('compute/image_type_exclude_list').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('DEFAULT/block_device_allocate_retries').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('DEFAULT/block_device_allocate_retries_interval').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('DEFAULT/flat_injected').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('DEFAULT/config_drive_format').with_value('<SERVICE DEFAULT>') }
it { is_expected.to_not contain_package('bridge-utils').with(
@ -296,6 +297,14 @@ describe 'nova::compute' do
it { is_expected.to contain_nova_config('DEFAULT/force_config_drive').with_value(true) }
end
context 'with flat_injected parameter set to true' do
let :params do
{ :flat_injected => true }
end
it { is_expected.to contain_nova_config('DEFAULT/flat_injected').with_value(true) }
end
context 'while not managing service state' do
let :params do
{