diff --git a/manifests/health_manager.pp b/manifests/health_manager.pp index 85b419fa..4cfa2620 100644 --- a/manifests/health_manager.pp +++ b/manifests/health_manager.pp @@ -25,6 +25,10 @@ # (optional) The bind ip for the health manager # Defaults to $::os_service_default # +# [*workers*] +# (optional) The number of workers health_manager spawns +# Defaults to $::os_workers +# # [*port*] # (optional) The bind port for the health manager # Defaults to $::os_service_default @@ -37,6 +41,7 @@ class octavia::health_manager ( $event_streamer_driver = $::os_service_default, $ip = $::os_service_default, $port = $::os_service_default, + $workers = $::os_workers, ) inherits octavia::params { include ::octavia::deps @@ -71,5 +76,7 @@ class octavia::health_manager ( 'health_manager/event_streamer_driver' : value => $event_streamer_driver; 'health_manager/bind_ip' : value => $ip; 'health_manager/bind_port' : value => $port; + 'health_manager/health_update_threads' : value => $workers; + 'health_manager/stats_update_threads' : value => $workers; } } diff --git a/releasenotes/notes/add-health_manager-worker-default-6259b601e01db4f3.yaml b/releasenotes/notes/add-health_manager-worker-default-6259b601e01db4f3.yaml new file mode 100644 index 00000000..3d8e7ebb --- /dev/null +++ b/releasenotes/notes/add-health_manager-worker-default-6259b601e01db4f3.yaml @@ -0,0 +1,4 @@ +--- +features: + - Add new parameter, "workers" to health_manager which + defaults to $::os_workers diff --git a/spec/classes/octavia_health_manager_spec.rb b/spec/classes/octavia_health_manager_spec.rb index 4e640af9..e592c5bf 100644 --- a/spec/classes/octavia_health_manager_spec.rb +++ b/spec/classes/octavia_health_manager_spec.rb @@ -33,6 +33,8 @@ describe 'octavia::health_manager' do }) end it { is_expected.to contain_octavia_config('health_manager/heartbeat_key').with_value('abcdefghi') } + it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value('2') } + it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value('2') } end it 'installs octavia-health-manager package' do @@ -97,6 +99,15 @@ describe 'octavia::health_manager' do it { is_expected.to contain_octavia_config('health_manager/bind_port').with_value('5555') } end + context 'configured with specific parameters' do + before do + params.merge!({ + :workers => 8, + }) + end + it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value(8) } + it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value(8) } + end end on_supported_os({