Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capture and http-response options to frontend #70

Merged
merged 2 commits into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions templates/backend.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ backend {{ item.name }}
{% if item.http_request is defined %}
{% include "http_request.cfg" %}
{% endif -%}
{% if item.http_response is defined %}
{% include "http_response.cfg" %}
{% endif -%}
{% if item.options is defined %}
{% for option in item.options %}
option {{ option }}
Expand Down
10 changes: 10 additions & 0 deletions templates/frontend.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ frontend {{ item.name }} {%if item.ip is defined %}{{ item.ip }}{% endif %}{%if
{% endfor -%}
{% endif -%}

{%- if item.capture is defined -%}
{%- for capture in item.capture -%}
capture {{ capture }}
{% endfor %}
{% endif -%}

{%- if item.reqadd is defined -%}
{%- for reqadd in item.reqadd -%}
reqadd {{ reqadd }}
Expand Down Expand Up @@ -83,6 +89,10 @@ frontend {{ item.name }} {%if item.ip is defined %}{{ item.ip }}{% endif %}{%if
{% include "http_request.cfg" %}
{% endif -%}

{% if item.http_response is defined %}
{% include "http_response.cfg" %}
{% endif -%}

{%- if item.default_backend is defined -%}
default_backend {{ item.default_backend }}
{% endif -%}
Expand Down
4 changes: 4 additions & 0 deletions templates/http_response.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{%- for response in item.http_response -%}
http-response {{ response.action }}{% if response.param is defined %} {{ response.param }}{% endif %}{% if response.condition is defined %} {{ response.condition }}{% endif %}

{% endfor -%}
6 changes: 6 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,19 @@ empty: true
# uri:
# fail:
# - <condition>
# condition:
# -
# acl:
# - name:
# condition:
# http_request:
# - action:
# param:
# condition:
# http_response:
# - action:
# param:
# condition:
# rate_limit_sessions:
# block:
# -
Expand Down