Skip to content

Commit a36c1d7

Browse files
author
Ian Clark
committed
adding listen and frontend options for rspirep
1 parent 0be6b4a commit a36c1d7

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ ansible.cfg
2828
# Other files #
2929
###############
3030
!empty
31+
*.sw[po]

README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
137137
* `haproxy_listen.{n}.rsprep`: [optional]: Response regexp edit definition
138138
* `haproxy_listen.{n}.rsprep.{n}.string`: [required]: Regexp definition to be used on response
139139
* `haproxy_listen.{n}.rsprep.{n}.cond`: [optional]: A condition to apply this rule
140+
* `haproxy_listen.{n}.rspirep`: [optional]: Response regexp edit definition
141+
* `haproxy_listen.{n}.rspirep.{n}.search`: [required]: The regular expression applied to HTTP headers and to the response line
142+
* `haproxy_listen.{n}.rspirep.{n}.string`: [required]: The complete line to be added
143+
* `haproxy_listen.{n}.rspirep.{n}.cond`: [optional]: Matching condition built from ACLs
140144
* `haproxy_listen.{n}.errorfile`: [optional]: Errorfile declarations
141145
* `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`)
142146
* `haproxy_listen.{n}.errorfile.{n}.file`: [required]: A file containing the full HTTP response (e.g `/etc/haproxy/errors/400.http`)
@@ -185,6 +189,10 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
185189
* `haproxy_frontend.{n}.rsprep`: [optional]: Response regexp edit definition
186190
* `haproxy_frontend.{n}.rsprep.{n}.string`: [required]: Regexp definition to be used on response
187191
* `haproxy_frontend.{n}.rsprep.{n}.cond`: [optional]: A condition to apply this rule
192+
* `haproxy_frontend.{n}.rspirep`: [optional]: Response regexp edit definition
193+
* `haproxy_frontend.{n}.rspirep.{n}.search`: [required]: The regular expression applied to HTTP headers and to the response line
194+
* `haproxy_frontend.{n}.rspirep.{n}.string`: [required]: The complete line to be added
195+
* `haproxy_frontend.{n}.rspirep.{n}.cond`: [optional]: Matching condition built from ACLs
188196
* `haproxy_frontend.{n}.compression`: [optional]: Compression declarations
189197
* `haproxy_frontend.{n}.compression.{n}.name`: [required]: The compression name (e.g. `algo`, `type`, `offload`)
190198
* `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)
@@ -202,9 +210,6 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
202210
* `haproxy_backend.{n}.option`: [optional]: Options to set (e.g. `[forwardfor]`)
203211
* `haproxy_backend.{n}.no_option`: [optional]: Options to unset (e.g. `[redispatch]`)
204212
* `haproxy_backend.{n}.http_check`: [optional]: Make HTTP health checks consider response contents or specific status codes (e.g. `expect status 403`)
205-
* `haproxy_backend.{n}.rspirep`: [optional]: Response regexp edit definition
206-
* `haproxy_backend.{n}.rspirep.{n}.string`: [required]: Regexp definition to be used on response (case insensitive)
207-
* `haproxy_backend.{n}.rspirep.{n}.cond`: [optional]: A condition to apply this rule
208213
* `haproxy_backend.{n}.stick`: [optional]: Stick declarations
209214
* `haproxy_backend.{n}.stick.{n}.table`: [required]: Configure the stickiness table for the current section (e.g. `type ip size 500k`)
210215
* `haproxy_backend.{n}.stick.{n}.stick_on`: [required]: Define a request pattern to associate a user to a server (e.g. `src`)
@@ -216,6 +221,10 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
216221
* `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`)
217222
* `haproxy_backend.{n}.acl`: [optional]: Create an ACL check which can be later used in evaluations/conditionals
218223
* `haproxy_backend.{n}.acl.{n}.string`: [required]: ACL entry to be used in conditional check later
224+
* `haproxy_backend.{n}.rspirep`: [optional]: Response regexp edit definition
225+
* `haproxy_backend.{n}.rspirep.{n}.search`: [required]: The regular expression applied to HTTP headers and to the response line
226+
* `haproxy_backend.{n}.rspirep.{n}.string`: [required]: The complete line to be added
227+
* `haproxy_backend.{n}.rspirep.{n}.cond`: [optional]: Matching condition built from ACLs
219228
* `haproxy_backend.{n}.cookie`: [optional]: Enable cookie-based persistence in a backend (e.g. `JSESSIONID prefix nocache`)
220229
* `haproxy_backend.{n}.http_request`: [optional]: Access control for Layer 7 requests
221230
* `haproxy_backend.{n}.http_request.{n}.action`: [required]: The rules action (e.g. `add-header`)

templates/etc/haproxy/backend.cfg.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ backend {{ backend.name }}
5858
{% endfor %}
5959

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

6363
{% endfor %}
6464

templates/etc/haproxy/frontend.cfg.j2

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ frontend {{ frontend.name }}
7676

7777
{% endfor %}
7878

79+
{% for rspirep in frontend.rspirep | default([]) %}
80+
rspirep {{ rspirep.search }} {{ rspirep.string }}{% if rspirep.cond is defined %} {{ rspirep.cond }}{% endif %}
81+
82+
{% endfor %}
83+
7984
{% for redirect in frontend.redirect | default([]) %}
8085
redirect {{ redirect.string }}{% if redirect.cond is defined %} {{ redirect.cond }}{% endif %}
8186

templates/etc/haproxy/listen.cfg.j2

+5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ listen {{ listen.name }}
104104

105105
{% endfor %}
106106

107+
{% for rspirep in listen.rspirep | default([]) %}
108+
rspirep {{ rspirep.search }} {{ rspirep.string }}{% if rspirep.cond is defined %} {{ rspirep.cond }}{% endif %}
109+
110+
{% endfor %}
111+
107112
{% for redirect in listen.redirect | default([]) %}
108113
redirect {{ redirect.string }}{% if redirect.cond is defined %} {{ redirect.cond }}{% endif %}
109114

0 commit comments

Comments
 (0)