Skip to content

Commit

Permalink
Change Yaml input from Dictionary to List
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beattie <[email protected]>
  • Loading branch information
mjbnz committed Nov 22, 2021
1 parent a62d58f commit f19a008
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
* `haproxy_listen.{n}.capture.name`: [required]: Name of the header or cookie to capture
* `haproxy_listen.{n}.capture.length`: [required]: Maximum number of characters to capture and report in the logs
* `haproxy_listen.{n}.filter`: [optional]: Dictionary of content filters to apply to this section
* `haproxy_listen.{n}.filter.{name}`: [required]: One or more filter `name: param` entries to apply
* `haproxy_listen.{n}.filter.{n}.name`: [required]: The filter to apply
* `haproxy_listen.{n}.filter.{n}.params`: [optional]: Parameters for the filter
* `haproxy_listen.{n}.http_request`: [optional]: Access control for Layer 7 requests
* `haproxy_listen.{n}.http_request.{n}.action`: [required]: The rules action (e.g. `add-header`)
* `haproxy_listen.{n}.http_request.{n}.param`: [optional]: The complete line to be added (e.g. `X-Forwarded-Proto https`)
Expand Down
6 changes: 2 additions & 4 deletions templates/etc/haproxy/backend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ backend {{ backend.name }}
{% if backend.cookie is defined %}
cookie {{ backend.cookie }}
{% endif %}
{% if backend.filter is defined %}
{% for name, value in backend.filter.items() %}
filter {{ name }} {{ value }}
{% for filter in backend.filter | default([]) %}
filter {{ filter.name }}{{ filter.params is defined | ternary([''] + [filter.params], []) | join(' ') }}
{% endfor %}
{% endif %}
{% for acl in backend.acl | default([]) %}
acl {{ acl.string }}
{% endfor %}
Expand Down
6 changes: 2 additions & 4 deletions templates/etc/haproxy/frontend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ frontend {{ frontend.name }}
{% for timeout in frontend.timeout | default([]) %}
timeout {{ timeout.type }} {{ timeout.timeout }}
{% endfor %}
{% if frontend.filter is defined %}
{% for name, value in frontend.filter.items() %}
filter {{ name }} {{ value }}
{% for filter in frontend.filter | default([]) %}
filter {{ filter.name }}{{ filter.params is defined | ternary([''] + [filter.params], []) | join(' ') }}
{% endfor %}
{% endif %}
{% for acl in frontend.acl | default([]) %}
acl {{ acl.string }}
{% endfor %}
Expand Down
6 changes: 2 additions & 4 deletions templates/etc/haproxy/listen.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ listen {{ listen.name }}
{% for timeout in listen.timeout | default([]) %}
timeout {{ timeout.type }} {{ timeout.timeout }}
{% endfor %}
{% if listen.filter is defined %}
{% for name, value in listen.filter.items() %}
filter {{ name }} {{ value }}
{% for filter in listen.filter | default([]) %}
filter {{ filter.name }}{{ filter.params is defined | ternary([''] + [filter.params], []) | join(' ') }}
{% endfor %}
{% endif %}
{% for acl in listen.acl | default([]) %}
acl {{ acl.string }}
{% endfor %}
Expand Down

0 comments on commit f19a008

Please sign in to comment.