From 5108129ad064eca2be8e925587c0de9dc08d619d Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 25 Mar 2024 10:33:21 +0900 Subject: [PATCH] guestagent: Support volume operation options Closes-Bug: #1485485 Change-Id: I9c5e44d4a8bd73e85efa1a8f254a228ad312d677 --- manifests/guestagent.pp | 32 +++++++++++++++++++ ...estagent-volume-opts-6552894cb095e53b.yaml | 11 +++++++ spec/classes/trove_guestagent_spec.rb | 5 +++ 3 files changed, 48 insertions(+) create mode 100644 releasenotes/notes/guestagent-volume-opts-6552894cb095e53b.yaml diff --git a/manifests/guestagent.pp b/manifests/guestagent.pp index 43c60b63..6834fa5a 100644 --- a/manifests/guestagent.pp +++ b/manifests/guestagent.pp @@ -80,6 +80,26 @@ # (optional) The plaintext registry password. # Defaults to $facts['os_service_default']. # +# [*num_tries*] +# (optional) Number of times to check if a volume exists. +# Defaults to $facts['os_service_default']. +# +# [*volume_fstype*] +# (optional) File system type used to format a volume. +# Defaults to $facts['os_service_default']. +# +# [*format_options*] +# (optional) Options to use when formatting a volume. +# Defaults to $facts['os_service_default']. +# +# [*volume_format_timeout*] +# (optional) Maximum time (in seconds) to wait for a volume format. +# Defaults to $facts['os_service_default']. +# +# [*mount_options*] +# (optional) Options to use when mounting a volume. +# Defaults to $facts['os_service_default']. +# # DEPRECATED PARAMETERS # # [*default_password_length*] @@ -108,6 +128,11 @@ class trove::guestagent( $container_registry = $facts['os_service_default'], $container_registry_username = $facts['os_service_default'], $container_registry_password = $facts['os_service_default'], + $num_tries = $facts['os_service_default'], + $volume_fstype = $facts['os_service_default'], + $format_options = $facts['os_service_default'], + $volume_format_timeout = $facts['os_service_default'], + $mount_options = $facts['os_service_default'], # DEPRECATED PARAMETERS $default_password_length = undef, $backup_aes_cbc_key = undef, @@ -196,4 +221,11 @@ class trove::guestagent( 'guest_agent/container_registry_password': value => $container_registry_password, secret => true; } + trove_guestagent_config { + 'DEFAULT/num_tries': value => $num_tries; + 'DEFAULT/volume_fstype': value => $volume_fstype; + 'DEFAULT/format_options': value => $format_options; + 'DEFAULT/volume_format_timeout': value => $volume_format_timeout; + 'DEFAULT/mount_options': value => $mount_options; + } } diff --git a/releasenotes/notes/guestagent-volume-opts-6552894cb095e53b.yaml b/releasenotes/notes/guestagent-volume-opts-6552894cb095e53b.yaml new file mode 100644 index 00000000..2f1c6915 --- /dev/null +++ b/releasenotes/notes/guestagent-volume-opts-6552894cb095e53b.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + The following parameters have been added to the ``trove::guestagent`` + class. + + - ``num_tries`` + - ``volume_fstype`` + - ``format_options`` + - ``volume_format_timeout`` + - ``mount_options`` diff --git a/spec/classes/trove_guestagent_spec.rb b/spec/classes/trove_guestagent_spec.rb index b45f28ef..d88851ea 100644 --- a/spec/classes/trove_guestagent_spec.rb +++ b/spec/classes/trove_guestagent_spec.rb @@ -85,6 +85,11 @@ describe 'trove::guestagent' do is_expected.to contain_trove_guestagent_config('guest_agent/container_registry').with_value('') is_expected.to contain_trove_guestagent_config('guest_agent/container_registry_username').with_value('') is_expected.to contain_trove_guestagent_config('guest_agent/container_registry_password').with_value('').with_secret(true) + is_expected.to contain_trove_guestagent_config('DEFAULT/num_tries').with_value('') + is_expected.to contain_trove_guestagent_config('DEFAULT/volume_fstype').with_value('') + is_expected.to contain_trove_guestagent_config('DEFAULT/format_options').with_value('') + is_expected.to contain_trove_guestagent_config('DEFAULT/volume_format_timeout').with_value('') + is_expected.to contain_trove_guestagent_config('DEFAULT/mount_options').with_value('') end it 'configures trove-guestagent with default logging parameters' do