diff --git a/README.md b/README.md index f3c8a74..e26f727 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,12 @@ Example - hosts: loadbalancers roles: - role: haproxy + haproxy_global: + - address: "/dev/log" + facility: "local0" + level: "info" + haproxy_extra_global_options: | + hard-stop-after 30s haproxy_frontends: - name: 'fe-mysupersite' ip: '123.123.123.120' diff --git a/defaults/main.yml b/defaults/main.yml index cad51cd..ff5cd2c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -72,3 +72,6 @@ haproxy_backends: [] haproxy_frontends: [] haproxy_listen: [] haproxy_userlists: [] + +haproxy_extra_global_options: [] +haproxy_extra_defaults_options: [] diff --git a/templates/defaults.cfg b/templates/defaults.cfg index 132c82f..ec3b759 100644 --- a/templates/defaults.cfg +++ b/templates/defaults.cfg @@ -85,4 +85,6 @@ defaults http-check send-state {% endif -%} {% endif -%} - +{% if haproxy_extra_defaults_options %} +{{ haproxy_extra_defaults_options }} +{% endif %} diff --git a/templates/global.cfg b/templates/global.cfg index 2034f8c..a3ddc6c 100644 --- a/templates/global.cfg +++ b/templates/global.cfg @@ -62,3 +62,6 @@ global tune.{{ param }} {{ value }} {% endfor -%} {% endif %} +{% if haproxy_extra_global_options %} +{{ haproxy_extra_global_options }} +{% endif %}