diff --git a/manifests/api.pp b/manifests/api.pp index e7948a3..4c97e23 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -24,12 +24,17 @@ # (Optional) Port on which murano api should listen # Defaults to $::os_service_default. # +# [*workers*] +# (Optional) Number of workers for Murano Api +# Defaults to $::os_workers +# class murano::api( $manage_service = true, $enabled = true, $package_ensure = 'present', $host = $::os_service_default, $port = $::os_service_default, + $workers = $::os_workers, ) { include ::murano::deps @@ -47,6 +52,7 @@ class murano::api( murano_config { 'DEFAULT/bind_host': value => $host; 'DEFAULT/bind_port': value => $port; + 'murano/api_workers': value => $workers; } package { 'murano-api': diff --git a/manifests/engine.pp b/manifests/engine.pp index 4d9a0aa..1083e84 100644 --- a/manifests/engine.pp +++ b/manifests/engine.pp @@ -40,7 +40,7 @@ class murano::engine( } murano_config { - 'engine/workers': value => $workers; + 'engine/engine_workers': value => $workers; } package { 'murano-engine': diff --git a/releasenotes/notes/add_api_workers_parameter-dbbc244aa5fe35f0.yaml b/releasenotes/notes/add_api_workers_parameter-dbbc244aa5fe35f0.yaml new file mode 100644 index 0000000..670ecda --- /dev/null +++ b/releasenotes/notes/add_api_workers_parameter-dbbc244aa5fe35f0.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add new parameter "workers" for api, the number of murano-api workers. diff --git a/spec/classes/murano_api_spec.rb b/spec/classes/murano_api_spec.rb index 89e0d73..1dd913f 100644 --- a/spec/classes/murano_api_spec.rb +++ b/spec/classes/murano_api_spec.rb @@ -8,15 +8,18 @@ describe 'murano::api' do context 'with default params' do it { is_expected.to contain_murano_config('DEFAULT/bind_host').with_value('') } it { is_expected.to contain_murano_config('DEFAULT/bind_port').with_value('') } + it { is_expected.to contain_murano_config('murano/api_workers').with_value(facts[:os_workers]) } end context 'with passed params' do let :params do { - :host => 'localhost', - :port => '1111', + :host => 'localhost', + :port => '1111', + :workers => '4', } end it { is_expected.to contain_murano_config('DEFAULT/bind_host').with_value('localhost') } it { is_expected.to contain_murano_config('DEFAULT/bind_port').with_value('1111') } + it { is_expected.to contain_murano_config('murano/api_workers').with_value('4') } end end diff --git a/spec/classes/murano_engine_spec.rb b/spec/classes/murano_engine_spec.rb index 2c27dc5..5c3d8eb 100644 --- a/spec/classes/murano_engine_spec.rb +++ b/spec/classes/murano_engine_spec.rb @@ -6,14 +6,14 @@ describe 'murano::engine' do it { is_expected.to contain_class('murano::engine') } context 'with default params' do - it { is_expected.to contain_murano_config('engine/workers').with_value('2') } + it { is_expected.to contain_murano_config('engine/engine_workers').with_value(facts[:os_workers]) } end context 'with passed workers' do let :params do { :workers => '4', } end - it { is_expected.to contain_murano_config('engine/workers').with_value('4') } + it { is_expected.to contain_murano_config('engine/engine_workers').with_value('4') } end end