diff --git a/manifests/worker.pp b/manifests/worker.pp index 904380c6..0a660151 100644 --- a/manifests/worker.pp +++ b/manifests/worker.pp @@ -14,6 +14,10 @@ # (optional) ensure state for package. # Defaults to 'present' # +# [*workers*] +# (optional) Number of worker processes. +# Defaults to $::os_service_default +# # [*amp_flavor_id*] # (optional) Nova instance flavor id for the Amphora. # Note: since we set manage_nova_flavor to True by default, we need @@ -88,6 +92,7 @@ class octavia::worker ( $manage_service = true, $enabled = true, $package_ensure = 'present', + $workers = $::os_service_default, $amp_flavor_id = '65', $amp_image_tag = $::os_service_default, $amp_secgroup_list = $::os_service_default, @@ -207,6 +212,7 @@ class octavia::worker ( } octavia_config { + 'controller_worker/workers' : value => $workers; 'controller_worker/amp_flavor_id' : value => $amp_flavor_id; 'controller_worker/amp_image_tag' : value => $amp_image_tag; 'controller_worker/amp_secgroup_list' : value => $amp_secgroup_list; diff --git a/releasenotes/notes/controller-workers-947eada7f23b5da9.yaml b/releasenotes/notes/controller-workers-947eada7f23b5da9.yaml new file mode 100644 index 00000000..5fe0d74a --- /dev/null +++ b/releasenotes/notes/controller-workers-947eada7f23b5da9.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added new parameter octavia::worker::workers that can be used to set the + number of worker processes. diff --git a/spec/classes/octavia_worker_spec.rb b/spec/classes/octavia_worker_spec.rb index e6371f5e..dacedb87 100644 --- a/spec/classes/octavia_worker_spec.rb +++ b/spec/classes/octavia_worker_spec.rb @@ -27,6 +27,7 @@ describe 'octavia::worker' do context 'configured with specific parameters' do before do params.merge!({ + :workers => 8, :amp_flavor_id => '42', :amp_image_tag => 'amphorae1', :amp_secgroup_list => ['lb-mgmt-sec-grp'], @@ -43,6 +44,7 @@ describe 'octavia::worker' do }) end + it { is_expected.to contain_octavia_config('controller_worker/workers').with_value(8) } it { is_expected.to contain_octavia_config('controller_worker/amp_flavor_id').with_value('42') } it { is_expected.to contain_octavia_config('controller_worker/amp_image_tag').with_value('amphorae1') } it { is_expected.to contain_octavia_config('controller_worker/amp_secgroup_list').with_value(['lb-mgmt-sec-grp']) } @@ -65,6 +67,7 @@ describe 'octavia::worker' do end it 'configures worker parameters' do + is_expected.to contain_octavia_config('controller_worker/workers').with_value('') is_expected.to contain_octavia_config('controller_worker/amp_flavor_id').with_value('65') is_expected.to contain_octavia_config('controller_worker/amphora_driver').with_value('amphora_haproxy_rest_driver') is_expected.to contain_octavia_config('controller_worker/compute_driver').with_value('compute_nova_driver')