From 602caf1fac96424320b92ea0aa69873acf2bee0c Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Thu, 30 Aug 2012 16:32:55 -0700 Subject: Update hash formatting for readability --- manifests/data.pp | 82 +++++++++++++++++++++++++++++++++---------------------- manifests/init.pp | 49 +++++++++++++++++---------------- 2 files changed, 76 insertions(+), 55 deletions(-) diff --git a/manifests/data.pp b/manifests/data.pp index effa0f8..ab920ed 100644 --- a/manifests/data.pp +++ b/manifests/data.pp @@ -7,40 +7,58 @@ class haproxy::data { case $osfamily { Redhat: { - $haproxy_global_options = { 'log' => "${::ipaddress} local0", - 'chroot' => '/var/lib/haproxy', - 'pidfile' => '/var/run/haproxy.pid', - 'maxconn' => '4000', - 'user' => 'haproxy', - 'group' => 'haproxy', - 'daemon' => '', - 'stats' => 'socket /var/lib/haproxy/stats' - } - $haproxy_defaults_options = { 'log' => 'global', - 'stats' => 'enable', - 'option' => 'redispatch', - 'retries' => '3', - 'timeout' => ['http-request 10s', 'queue 1m', 'connect 10s', 'client 1m', 'server 1m', 'check 10s'], - 'maxconn' => '8000' - } + $haproxy_global_options = { + 'log' => "${::ipaddress} local0", + 'chroot' => '/var/lib/haproxy', + 'pidfile' => '/var/run/haproxy.pid', + 'maxconn' => '4000', + 'user' => 'haproxy', + 'group' => 'haproxy', + 'daemon' => '', + 'stats' => 'socket /var/lib/haproxy/stats' + } + $haproxy_defaults_options = { + 'log' => 'global', + 'stats' => 'enable', + 'option' => 'redispatch', + 'retries' => '3', + 'timeout' => [ + 'http-request 10s', + 'queue 1m', + 'connect 10s', + 'client 1m', + 'server 1m', + 'check 10s', + ], + 'maxconn' => '8000' + } } Debian: { - $haproxy_global_options = { 'log' => "${::ipaddress} local0", - 'chroot' => '/var/lib/haproxy', - 'pidfile' => '/var/run/haproxy.pid', - 'maxconn' => '4000', - 'user' => 'haproxy', - 'group' => 'haproxy', - 'daemon' => '', - 'stats' => 'socket /var/lib/haproxy/stats' - } - $haproxy_defaults_options = { 'log' => 'global', - 'stats' => 'enable', - 'option' => 'redispatch', - 'retries' => '3', - 'timeout' => ['http-request 10s', 'queue 1m', 'connect 10s', 'client 1m', 'server 1m', 'check 10s'], - 'maxconn' => '8000' - } + $haproxy_global_options = { + 'log' => "${::ipaddress} local0", + 'chroot' => '/var/lib/haproxy', + 'pidfile' => '/var/run/haproxy.pid', + 'maxconn' => '4000', + 'user' => 'haproxy', + 'group' => 'haproxy', + 'daemon' => '', + 'stats' => 'socket /var/lib/haproxy/stats' + } + $haproxy_defaults_options = { + 'log' => 'global', + 'stats' => 'enable', + 'option' => 'redispatch', + 'retries' => '3', + 'timeout' => [ + 'http-request 10s', + 'queue 1m', + 'connect 10s', + 'client 1m', + 'server 1m', + 'check 10s', + ], + 'maxconn' => '8000' + } } default: { fail("The $::osfamily operating system is not supported with the haproxy module") } } diff --git a/manifests/init.pp b/manifests/init.pp index f75051c..c36b1ae 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -31,29 +31,32 @@ # === Examples # # class { 'haproxy': -# enable => true, -# haproxy_global_options => { 'log' => "${::ipaddress} local0", -# 'chroot' => '/var/lib/haproxy', -# 'pidfile' => '/var/run/haproxy.pid', -# 'maxconn' => '4000', -# 'user' => 'haproxy', -# 'group' => 'haproxy', -# 'daemon' => '', -# 'stats' => 'socket /var/lib/haproxy/stats' -# }, -# haproxy_defaults_options => { 'log' => 'global', -# 'stats' => 'enable', -# 'option' => 'redispatch', -# 'retries' => '3', -# 'timeout' => ['http-request 10s', -# 'queue 1m', -# 'connect 10s', -# 'client 1m', -# 'server 1m', -# 'check 10s'], -# 'maxconn' => '8000' -# }, -# +# enable => true, +# haproxy_global_options => { +# 'log' => "${::ipaddress} local0", +# 'chroot' => '/var/lib/haproxy', +# 'pidfile' => '/var/run/haproxy.pid', +# 'maxconn' => '4000', +# 'user' => 'haproxy', +# 'group' => 'haproxy', +# 'daemon' => '', +# 'stats' => 'socket /var/lib/haproxy/stats' +# }, +# haproxy_defaults_options => { +# 'log' => 'global', +# 'stats' => 'enable', +# 'option' => 'redispatch', +# 'retries' => '3', +# 'timeout' => [ +# 'http-request 10s', +# 'queue 1m', +# 'connect 10s', +# 'client 1m', +# 'server 1m', +# 'check 10s' +# ], +# 'maxconn' => '8000' +# }, # } # # === Authors -- cgit v1.2.3 From 37193348a660c14718dc0503cda687849c3ccad3 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Wed, 10 Oct 2012 11:54:51 -0700 Subject: Update haproxy::config for indentation and Puppet 2.6 --- manifests/config.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 444905b..f47e387 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -71,10 +71,14 @@ define haproxy::config ( $order = '20', $virtual_ip = $::ipaddress, $mode = 'tcp', - $haproxy_config_options = {'option' => ['tcplog', - 'ssl-hello-chk'], - 'balance' => 'roundrobin'}, $collect_exported = true, + $haproxy_config_options = { + 'option' => [ + 'tcplog', + 'ssl-hello-chk' + ], + 'balance' => 'roundrobin' + } ) { concat::fragment { "${name}_config_block": order => $order, -- cgit v1.2.3