From 7e31bee197d0b159edbadb65f1e60792df649193 Mon Sep 17 00:00:00 2001 From: Troy Date: Mon, 13 Jul 2015 16:17:06 -0700 Subject: [PATCH] Allowed for default balance balance with default of roundrobin, and allowed for lack of balance in the backends --- haproxy/templates/haproxy.jinja | 3 +++ 1 file changed, 3 insertions(+) diff --git a/haproxy/templates/haproxy.jinja b/haproxy/templates/haproxy.jinja index 2fb5195..df944e5 100644 --- a/haproxy/templates/haproxy.jinja +++ b/haproxy/templates/haproxy.jinja @@ -33,6 +33,7 @@ defaults log {{ salt['pillar.get']('haproxy:defaults:log') }} mode {{ salt['pillar.get']('haproxy:defaults:mode') }} retries {{ salt['pillar.get']('haproxy:defaults:retries') }} + balance {{ salt['pillar.get']('haproxy:defaults:balance', 'roundrobin') }} {%- if 'options' in salt['pillar.get']('haproxy:defaults', {}) %} {%- for option in salt['pillar.get']('haproxy:defaults:options') %} option {{ option }} @@ -94,7 +95,9 @@ backend {{ backend[1].name }} {%- for redirect in backend[1].redirects %} # Redirect loop start redirect {{ redirect }}{% endfor %} {%- endif %} + {%- if 'balance' in backend[1] %} balance {{ backend[1].balance }} + {%- endif %} {%- if 'options' in backend[1] %} {%- for option in backend[1].options %} option {{ option }}