From 81ec750cf50e8050e66590c5e03f8f20a213aab0 Mon Sep 17 00:00:00 2001 From: "Matthew J. Black" Date: Sat, 17 Dec 2016 22:00:21 -0500 Subject: [PATCH] Added parameters to configure ip and port The health manager manifest is missing two configuration parameters to configure the health manager bind_ip and bind_port. Change-Id: I566374b0dc7f8f696d440ffe152565a3bd47e1e5 --- manifests/health_manager.pp | 14 +++++++++++++- spec/classes/octavia_health_manager_spec.rb | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/manifests/health_manager.pp b/manifests/health_manager.pp index dd2559e0..85b419fa 100644 --- a/manifests/health_manager.pp +++ b/manifests/health_manager.pp @@ -21,12 +21,22 @@ # (optional) Driver to use for synchronizing octavia and lbaas databases. # Defaults to $::os_service_default # +# [*ip*] +# (optional) The bind ip for the health manager +# Defaults to $::os_service_default +# +# [*port*] +# (optional) The bind port for the health manager +# Defaults to $::os_service_default +# class octavia::health_manager ( $heartbeat_key, $manage_service = true, $enabled = true, $package_ensure = 'present', $event_streamer_driver = $::os_service_default, + $ip = $::os_service_default, + $port = $::os_service_default, ) inherits octavia::params { include ::octavia::deps @@ -58,6 +68,8 @@ class octavia::health_manager ( octavia_config { 'health_manager/heartbeat_key' : value => $heartbeat_key; - 'health_manager/event_streamer_driver' : value => $event_streamer_driver, + 'health_manager/event_streamer_driver' : value => $event_streamer_driver; + 'health_manager/bind_ip' : value => $ip; + 'health_manager/bind_port' : value => $port; } } diff --git a/spec/classes/octavia_health_manager_spec.rb b/spec/classes/octavia_health_manager_spec.rb index 50578a2b..4e640af9 100644 --- a/spec/classes/octavia_health_manager_spec.rb +++ b/spec/classes/octavia_health_manager_spec.rb @@ -81,6 +81,22 @@ describe 'octavia::health_manager' do end end + context 'with host and port default values' do + it { is_expected.to contain_octavia_config('health_manager/bind_ip').with_value('') } + it { is_expected.to contain_octavia_config('health_manager/bind_port').with_value('') } + end + + context 'with host and port values override' do + before do + params.merge!({ + :ip => '10.0.0.15', + :port => '5555'}) + end + + it { is_expected.to contain_octavia_config('health_manager/bind_ip').with_value('10.0.0.15') } + it { is_expected.to contain_octavia_config('health_manager/bind_port').with_value('5555') } + end + end on_supported_os({