From 088dd3aa28996ed2b690454f72b0c83f73790b8b Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Mon, 19 Nov 2012 13:03:36 -0800 Subject: Order listening services better With the recent additions of multiple-listen-service ordering, the order using the concat-fragment depended on the end-of-line vs other alphanumeric characters. This is not actually the case with the concat module, so this fixes ordering for services under a small set of edge cases. This adds the smaller edge case of if a balancermember begins with "00". --- manifests/listen.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/listen.pp b/manifests/listen.pp index ee9e320..00636e3 100644 --- a/manifests/listen.pp +++ b/manifests/listen.pp @@ -82,7 +82,7 @@ define haproxy::listen ( ) { # Template uses: $name, $ipaddress, $ports, $options concat::fragment { "${name}_listen_block": - order => "20-${name}", + order => "20-${name}-00", target => '/etc/haproxy/haproxy.cfg', content => template('haproxy/haproxy_listen_block.erb'), } -- cgit v1.2.3 From 1bea8b8aea88eeb689f6cfc8d9d190ae94d6eda1 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 20 Nov 2012 09:55:55 -0800 Subject: Update spec tests --- spec/defines/listen_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/defines/listen_spec.rb b/spec/defines/listen_spec.rb index 6102285..31dd4c8 100644 --- a/spec/defines/listen_spec.rb +++ b/spec/defines/listen_spec.rb @@ -12,7 +12,7 @@ describe 'haproxy::listen' do end it { should contain_concat__fragment('croy_listen_block').with( - 'order' => '20-croy', + 'order' => '20-croy-00', 'target' => '/etc/haproxy/haproxy.cfg', 'content' => "listen croy\n\n bind 1.1.1.1:18140\n\n balance roundrobin\n option tcplog\n option ssl-hello-chk\n" ) } @@ -30,7 +30,7 @@ describe 'haproxy::listen' do end it { should contain_concat__fragment('apache_listen_block').with( - 'order' => '20-apache', + 'order' => '20-apache-00', 'target' => '/etc/haproxy/haproxy.cfg', 'content' => "listen apache\n\n bind 23.23.23.23:80\n\n bind 23.23.23.23:443\n\n balance roundrobin\n option tcplog\n option ssl-hello-chk\n" ) } @@ -45,7 +45,7 @@ describe 'haproxy::listen' do end it { should contain_concat__fragment('apache_listen_block').with( - 'order' => '20-apache', + 'order' => '20-apache-00', 'target' => '/etc/haproxy/haproxy.cfg', 'content' => "listen apache\n\n bind 23.23.23.23:80\n\n bind 23.23.23.23:443\n\n balance roundrobin\n option tcplog\n option ssl-hello-chk\n" ) } -- cgit v1.2.3