Skip to content

Commit

Permalink
Merge pull request #70 from vmfarms/capture
Browse files Browse the repository at this point in the history
Add capture and http-response options to frontend
  • Loading branch information
benwebber authored Mar 15, 2017
2 parents 2d2e421 + 5b79c6e commit 8a2c88a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
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 @@ -107,6 +113,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

0 comments on commit 8a2c88a

Please sign in to comment.