From afd9b762a4f4d4ea50d6aeac402f0d300d346c44 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 2 Oct 2025 15:35:51 +0900 Subject: [PATCH] coordination: Expose parameters for package management Change-Id: Ia60d3f4ef60ba28da9d5103b4bb80eefd3092331 Signed-off-by: Takashi Kajinami --- manifests/orchestrator.pp | 24 ++++++++++++++----- ...ation-package-params-9b7bf03ecf21e91e.yaml | 8 +++++++ spec/classes/cloudkitty_orchestrator_spec.rb | 14 +++++++---- 3 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/coordination-package-params-9b7bf03ecf21e91e.yaml diff --git a/manifests/orchestrator.pp b/manifests/orchestrator.pp index fd02d39..6f1b6c4 100644 --- a/manifests/orchestrator.pp +++ b/manifests/orchestrator.pp @@ -20,17 +20,29 @@ # (Optional) Maximum number of threads to use per worker. # Defaults to 16, # +# [*manage_backend_package*] +# (Optional) Whether to install the backend package. +# Defaults to true. +# +# [*backend_package_ensure*] +# (Optional) ensure state for backend package. +# Defaults to 'present' +# class cloudkitty::orchestrator ( - $coordination_url = $facts['os_service_default'], - $max_workers = $facts['os_workers'], - $max_workers_reprocessing = $facts['os_workers'], - $max_threads = 16, + $coordination_url = $facts['os_service_default'], + $max_workers = $facts['os_workers'], + $max_workers_reprocessing = $facts['os_workers'], + $max_threads = 16, + Boolean $manage_backend_package = true, + Stdlib::Ensure::Package $backend_package_ensure = present, ) { include cloudkitty::deps oslo::coordination { 'cloudkitty_config': - backend_url => $coordination_url, - manage_config => false, + backend_url => $coordination_url, + manage_backend_package => $manage_backend_package, + package_ensure => $backend_package_ensure, + manage_config => false, } # all coordination settings should be applied and all packages should be diff --git a/releasenotes/notes/coordination-package-params-9b7bf03ecf21e91e.yaml b/releasenotes/notes/coordination-package-params-9b7bf03ecf21e91e.yaml new file mode 100644 index 0000000..1ea7616 --- /dev/null +++ b/releasenotes/notes/coordination-package-params-9b7bf03ecf21e91e.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The following parameters have been added to + the ``cloudkitty::orchestrator`` class. + + - ``manage_backend_package`` + - ``backend_package_ensure`` diff --git a/spec/classes/cloudkitty_orchestrator_spec.rb b/spec/classes/cloudkitty_orchestrator_spec.rb index 4cf7503..94c25e6 100644 --- a/spec/classes/cloudkitty_orchestrator_spec.rb +++ b/spec/classes/cloudkitty_orchestrator_spec.rb @@ -11,8 +11,10 @@ describe 'cloudkitty::orchestrator' do is_expected.to contain_cloudkitty_config('orchestrator/coordination_url')\ .with_value('').with_secret(true) is_expected.to contain_oslo__coordination('cloudkitty_config').with( - :backend_url => '', - :manage_config => false, + :backend_url => '', + :manage_backend_package => true, + :package_ensure => 'present', + :manage_config => false, ) is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value(4) is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value(4) @@ -27,6 +29,8 @@ describe 'cloudkitty::orchestrator' do :max_workers => 4, :max_workers_reprocessing => 5, :max_threads => 20, + :manage_backend_package => false, + :backend_package_ensure => 'latest', } end @@ -34,8 +38,10 @@ describe 'cloudkitty::orchestrator' do is_expected.to contain_cloudkitty_config('orchestrator/coordination_url')\ .with_value('etcd3+http://127.0.0.1:2379').with_secret(true) is_expected.to contain_oslo__coordination('cloudkitty_config').with( - :backend_url => 'etcd3+http://127.0.0.1:2379', - :manage_config => false, + :backend_url => 'etcd3+http://127.0.0.1:2379', + :manage_backend_package => false, + :package_ensure => 'latest', + :manage_config => false, ) is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value(4) is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value(5)