diff --git a/README.md b/README.md index 270c4f93..ee06199f 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst * `haproxy_global_peers.{n}.peers`: Peer declarations * `haproxy_global_peers.{n}.peers.{n}.name`: [required]: Name of the host (recommended to be `hostname`) (e.g. `haproxy1`) * `haproxy_global_peers.{n}.peers.{n}.listen`: [required]: IP and port for peer to listen/connect to (e.g. `192.168.0.1:1024`) -* `haproxy_global_raw_options`: [default: []]: additional arbitrary lines to insert in the global section +* `haproxy_global_raw_options`: [default: `[]`]: Additional arbitrary lines to insert in the section * `haproxy_defaults_log`: [default: `global`]: Enable per-instance logging of events and traffic. `global` should be used when the instance's logging parameters are the same as the global ones. This is the most common usage * `haproxy_defaults_logformat`: [optional]: Allows you to customize the logs in http mode and tcp mode (e.g. `%{+Q}o\ %t\ %s\ %{-Q}r`) @@ -70,7 +70,7 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst * `haproxy_defaults_compression.{}.name`: [required]: The compression name (e.g. `algo`, `type`, `offload`) * `haproxy_defaults_compression.{}.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) * `haproxy_default_server_params`: [optional]: Default server backend parameters passed to each backend/listen server. -* `haproxy_default_raw_options`: [default: []]: additional arbitrary lines to insert in the default section +* `haproxy_default_raw_options`: [default: `[]`]: Additional arbitrary lines to insert in the section * `haproxy_ssl_map`: [default: `[]`]: SSL declarations * `haproxy_ssl_map.{n}.src`: The local path of the file to copy, can be absolute or relative (e.g. `../../../files/haproxy/etc/haproxy/ssl/star-example-com.pem`) @@ -183,7 +183,7 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst * `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`) * `haproxy_listen.{n}.default_server_params`: [optional]: Default server params applied for each server for this particular listen entry. -* `haproxy_listen.{n}.raw_options`: [default: []]: additional arbitrary lines to insert in the section +* `haproxy_listen.{n}.raw_options`: [default: `[]`]: Additional arbitrary lines to insert in the section * `haproxy_frontend`: [default: `[]`]: Front-end declarations * `haproxy_frontend.{n}.name`: [required]: The name of the section (e.g. `https`) @@ -273,7 +273,7 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst * `haproxy_frontend.{n}.errorfile`: [optional]: Errorfile declarations * `haproxy_frontend.{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_frontend.{n}.errorfile.{n}.file`: [required]: A file containing the full HTTP response (e.g `/etc/haproxy/errors/400.http`) -* `haproxy_frontend.{n}.raw_options`: [default: []]: additional arbitrary lines to insert in the section +* `haproxy_frontend.{n}.raw_options`: [default: `[]`]: Additional arbitrary lines to insert in the section * `haproxy_backend`: [default: `[]`]: Back-end declarations * `haproxy_backend.{n}.name`: [required]: The name of the section (e.g. `webservers`) @@ -364,7 +364,7 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst * `haproxy_backend.{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_backend.{n}.errorfile.{n}.file`: [required]: A file containing the full HTTP response (e.g `/etc/haproxy/errors/400.http`) * `haproxy_backend.{n}.default_server_params`: [optional]: Default server params applied for each server for this particular backend entry. -* `haproxy_backend.{n}.raw_options`: [default: []]: additional arbitrary lines to insert in the section +* `haproxy_backend.{n}.raw_options`: [default: `[]`]: Additional arbitrary lines to insert in the section * `haproxy_userlists`: [default: `[]`]: Userlist declarations * `haproxy_userlists.{n}.name`: [required]: The name of the userlist diff --git a/templates/etc/haproxy/backend.cfg.j2 b/templates/etc/haproxy/backend.cfg.j2 index 1ef11746..8a50ea2f 100644 --- a/templates/etc/haproxy/backend.cfg.j2 +++ b/templates/etc/haproxy/backend.cfg.j2 @@ -134,6 +134,7 @@ backend {{ backend.name }} {% for errorfile in backend.errorfile | default([]) %} errorfile {{ errorfile.code }} {{ errorfile.file }} {% endfor %} + {% for line in backend.raw_options | default([]) %} {{ line }} {% endfor %} diff --git a/templates/etc/haproxy/defaults.cfg.j2 b/templates/etc/haproxy/defaults.cfg.j2 index 408edef6..8abe4df5 100644 --- a/templates/etc/haproxy/defaults.cfg.j2 +++ b/templates/etc/haproxy/defaults.cfg.j2 @@ -43,6 +43,7 @@ {% if haproxy_default_server_params | default([]) %} default-server {% for param in haproxy_default_server_params | default([]) %} {{ param }}{% endfor %} {% endif %} -{% for line in haproxy_default_raw_options %} + +{% for line in haproxy_default_raw_options | default([]) %} {{ line }} {% endfor %} diff --git a/templates/etc/haproxy/frontend.cfg.j2 b/templates/etc/haproxy/frontend.cfg.j2 index 7e073e09..d1867914 100644 --- a/templates/etc/haproxy/frontend.cfg.j2 +++ b/templates/etc/haproxy/frontend.cfg.j2 @@ -128,6 +128,7 @@ frontend {{ frontend.name }} {% for errorfile in frontend.errorfile | default([]) %} errorfile {{ errorfile.code }} {{ errorfile.file }} {% endfor %} + {% for line in frontend.raw_options | default([]) %} {{ line }} {% endfor %} diff --git a/templates/etc/haproxy/global.cfg.j2 b/templates/etc/haproxy/global.cfg.j2 index f3fa986a..81e9bb89 100644 --- a/templates/etc/haproxy/global.cfg.j2 +++ b/templates/etc/haproxy/global.cfg.j2 @@ -98,6 +98,7 @@ peers {{ peers.name }} peer {{ peer.name }} {{ peer.listen }} {% endfor %} {% endfor %} + {% for line in haproxy_global_raw_options | default([]) %} {{ line }} {% endfor %} diff --git a/templates/etc/haproxy/listen.cfg.j2 b/templates/etc/haproxy/listen.cfg.j2 index 37cd2892..f3b9e301 100644 --- a/templates/etc/haproxy/listen.cfg.j2 +++ b/templates/etc/haproxy/listen.cfg.j2 @@ -156,6 +156,7 @@ listen {{ listen.name }} {% for errorfile in listen.errorfile | default([]) %} errorfile {{ errorfile.code }} {{ errorfile.file }} {% endfor %} + {% for line in listen.raw_options | default([]) %} {{ line }} {% endfor %}