Skip to content

Commit

Permalink
Evaluation of boolean in jinja haproxy template
Browse files Browse the repository at this point in the history
  • Loading branch information
nuriel77 committed Jun 11, 2018
1 parent 48550e3 commit 3a1b8ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/loadbalancer/templates/haproxy.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ frontend iri_front
option log-separate-errors
option http-buffer-request

{% if haproxy_use_whitelist_file is defined and haproxy_use_whitelist_file and haproxy_whitelist_file is defined %}
{% if haproxy_use_whitelist_file is defined and haproxy_use_whitelist_file|bool == True and haproxy_whitelist_file is defined %}
acl whitelist src -f {{ haproxy_whitelist_file }}
{% else %}
acl whitelist src {{ haproxy_whitelist | join(" ") }}
Expand Down Expand Up @@ -109,7 +109,7 @@ backend iri_back
timeout server-fin 5m
filter compression

{% if haproxy_use_whitelist_file is defined and haproxy_use_whitelist_file and haproxy_whitelist_file is defined %}
{% if haproxy_use_whitelist_file is defined and haproxy_use_whitelist_file|bool == True and haproxy_whitelist_file is defined %}
acl whitelist src -f {{ haproxy_whitelist_file }}
{% else %}
acl whitelist src {{ haproxy_whitelist | join(" ") }}
Expand Down

0 comments on commit 3a1b8ff

Please sign in to comment.