Skip to content

Commit

Permalink
adding listen and frontend options for rspirep
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Clark committed May 16, 2018
1 parent 0be6b4a commit a36c1d7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ ansible.cfg
# Other files #
###############
!empty
*.sw[po]
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
* `haproxy_listen.{n}.rsprep`: [optional]: Response regexp edit definition
* `haproxy_listen.{n}.rsprep.{n}.string`: [required]: Regexp definition to be used on response
* `haproxy_listen.{n}.rsprep.{n}.cond`: [optional]: A condition to apply this rule
* `haproxy_listen.{n}.rspirep`: [optional]: Response regexp edit definition
* `haproxy_listen.{n}.rspirep.{n}.search`: [required]: The regular expression applied to HTTP headers and to the response line
* `haproxy_listen.{n}.rspirep.{n}.string`: [required]: The complete line to be added
* `haproxy_listen.{n}.rspirep.{n}.cond`: [optional]: Matching condition built from ACLs
* `haproxy_listen.{n}.errorfile`: [optional]: Errorfile declarations
* `haproxy_listen.{n}.errorfile.{n}.code`: [required]: The HTTP status code. Currently, HAProxy is capable of generating codes 200, 400, 403, 408, 500, 502, 503, and 504 (e.g. `400`)
* `haproxy_listen.{n}.errorfile.{n}.file`: [required]: A file containing the full HTTP response (e.g `/etc/haproxy/errors/400.http`)
Expand Down Expand Up @@ -185,6 +189,10 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
* `haproxy_frontend.{n}.rsprep`: [optional]: Response regexp edit definition
* `haproxy_frontend.{n}.rsprep.{n}.string`: [required]: Regexp definition to be used on response
* `haproxy_frontend.{n}.rsprep.{n}.cond`: [optional]: A condition to apply this rule
* `haproxy_frontend.{n}.rspirep`: [optional]: Response regexp edit definition
* `haproxy_frontend.{n}.rspirep.{n}.search`: [required]: The regular expression applied to HTTP headers and to the response line
* `haproxy_frontend.{n}.rspirep.{n}.string`: [required]: The complete line to be added
* `haproxy_frontend.{n}.rspirep.{n}.cond`: [optional]: Matching condition built from ACLs
* `haproxy_frontend.{n}.compression`: [optional]: Compression declarations
* `haproxy_frontend.{n}.compression.{n}.name`: [required]: The compression name (e.g. `algo`, `type`, `offload`)
* `haproxy_frontend.{n}.compression.{n}.value`: [required]: The compression value, (e.g. if name = algo : one of this values `identity`, `gzip`, `deflate`, `raw-deflate` / if name = type : list of mime type separated by space for example `text/html text/plain text/css` / if name = `offload` value is empty)
Expand All @@ -202,9 +210,6 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
* `haproxy_backend.{n}.option`: [optional]: Options to set (e.g. `[forwardfor]`)
* `haproxy_backend.{n}.no_option`: [optional]: Options to unset (e.g. `[redispatch]`)
* `haproxy_backend.{n}.http_check`: [optional]: Make HTTP health checks consider response contents or specific status codes (e.g. `expect status 403`)
* `haproxy_backend.{n}.rspirep`: [optional]: Response regexp edit definition
* `haproxy_backend.{n}.rspirep.{n}.string`: [required]: Regexp definition to be used on response (case insensitive)
* `haproxy_backend.{n}.rspirep.{n}.cond`: [optional]: A condition to apply this rule
* `haproxy_backend.{n}.stick`: [optional]: Stick declarations
* `haproxy_backend.{n}.stick.{n}.table`: [required]: Configure the stickiness table for the current section (e.g. `type ip size 500k`)
* `haproxy_backend.{n}.stick.{n}.stick_on`: [required]: Define a request pattern to associate a user to a server (e.g. `src`)
Expand All @@ -216,6 +221,10 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
* `haproxy_backend.{n}.timeout.timeout`: [required]: The timeout (in in milliseconds by default, but can be in any other unit if the number is suffixed by the unit) (e.g. `5000`, `50000`)
* `haproxy_backend.{n}.acl`: [optional]: Create an ACL check which can be later used in evaluations/conditionals
* `haproxy_backend.{n}.acl.{n}.string`: [required]: ACL entry to be used in conditional check later
* `haproxy_backend.{n}.rspirep`: [optional]: Response regexp edit definition
* `haproxy_backend.{n}.rspirep.{n}.search`: [required]: The regular expression applied to HTTP headers and to the response line
* `haproxy_backend.{n}.rspirep.{n}.string`: [required]: The complete line to be added
* `haproxy_backend.{n}.rspirep.{n}.cond`: [optional]: Matching condition built from ACLs
* `haproxy_backend.{n}.cookie`: [optional]: Enable cookie-based persistence in a backend (e.g. `JSESSIONID prefix nocache`)
* `haproxy_backend.{n}.http_request`: [optional]: Access control for Layer 7 requests
* `haproxy_backend.{n}.http_request.{n}.action`: [required]: The rules action (e.g. `add-header`)
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/haproxy/backend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ backend {{ backend.name }}
{% endfor %}

{% for rspirep in backend.rspirep | default([]) %}
rspirep {{ rspirep.string }}{% if rspirep.cond is defined %} {{ rspirep.cond }}{% endif %}
rspirep {{ rspirep.search }} {{ rspirep.string }}{% if rspirep.cond is defined %} {{ rspirep.cond }}{% endif %}

{% endfor %}

Expand Down
5 changes: 5 additions & 0 deletions templates/etc/haproxy/frontend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ frontend {{ frontend.name }}

{% endfor %}

{% for rspirep in frontend.rspirep | default([]) %}
rspirep {{ rspirep.search }} {{ rspirep.string }}{% if rspirep.cond is defined %} {{ rspirep.cond }}{% endif %}

{% endfor %}

{% for redirect in frontend.redirect | default([]) %}
redirect {{ redirect.string }}{% if redirect.cond is defined %} {{ redirect.cond }}{% endif %}

Expand Down
5 changes: 5 additions & 0 deletions templates/etc/haproxy/listen.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ listen {{ listen.name }}

{% endfor %}

{% for rspirep in listen.rspirep | default([]) %}
rspirep {{ rspirep.search }} {{ rspirep.string }}{% if rspirep.cond is defined %} {{ rspirep.cond }}{% endif %}

{% endfor %}

{% for redirect in listen.redirect | default([]) %}
redirect {{ redirect.string }}{% if redirect.cond is defined %} {{ redirect.cond }}{% endif %}

Expand Down

0 comments on commit a36c1d7

Please sign in to comment.