From e9c8674989a04a1e1bf809345fe8aa91c88bc014 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Fri, 14 Aug 2015 13:23:55 +0200 Subject: [PATCH] Do not send not existing values to haproxy If facter is not providing values for ipaddress or ipaddress6, it's causing rules with undef content to be created into haproxy.cfg So check if these settings have a defined value before adding that to the manifest. Change-Id: I18256fe5aaf71626ea458a0a3d949f8adea5d72c --- manifests/lb.pp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/lb.pp b/manifests/lb.pp index 3be23b0..fdcab6b 100644 --- a/manifests/lb.pp +++ b/manifests/lb.pp @@ -49,8 +49,10 @@ class cgit::lb ( }, } # The three listen defines here are what the world will hit. + $haproxy_addresses = delete_undef_values([$::ipaddress, $::ipaddress6]) + haproxy::listen { 'balance_git_http': - ipaddress => [$::ipaddress, $::ipaddress6], + ipaddress => $haproxy_addresses, ports => ['80'], mode => 'tcp', collect_exported => false, @@ -62,7 +64,7 @@ class cgit::lb ( }, } haproxy::listen { 'balance_git_https': - ipaddress => [$::ipaddress, $::ipaddress6], + ipaddress => $haproxy_addresses, ports => ['443'], mode => 'tcp', collect_exported => false, @@ -74,7 +76,7 @@ class cgit::lb ( }, } haproxy::listen { 'balance_git_daemon': - ipaddress => [$::ipaddress, $::ipaddress6], + ipaddress => $haproxy_addresses, ports => ['9418'], mode => 'tcp', collect_exported => false,