From cc0c51badf8015a0ef83c0c3a6c612f644f3477e Mon Sep 17 00:00:00 2001 From: Ryan MacDonald Date: Thu, 11 Oct 2018 09:23:57 -0400 Subject: [PATCH 1/5] global section config bloc support global configuration bloc support --- templates/global.cfg | 3 +++ 1 file changed, 3 insertions(+) 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 %} From 1b06622be6a3c6d33c0693bfe156289bbb7b960a Mon Sep 17 00:00:00 2001 From: Ryan MacDonald Date: Thu, 11 Oct 2018 09:25:24 -0400 Subject: [PATCH 2/5] defaults section config bloc support defaults section config bloc support --- templates/defaults.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 %} From aec344a4f5e485d99b607995cde286ed723b1ad7 Mon Sep 17 00:00:00 2001 From: Ryan MacDonald Date: Thu, 11 Oct 2018 09:49:55 -0400 Subject: [PATCH 3/5] expand example context - add an example of haproxy_global usage - add an example of haproxy_extra_global_options --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) 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' From 51d83fe7cac8811a953dc66189544d03dc925fff Mon Sep 17 00:00:00 2001 From: Ryan MacDonald Date: Thu, 11 Oct 2018 15:43:29 -0500 Subject: [PATCH 4/5] add defaults for haproxy_extra code blocs --- defaults/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index cad51cd..9bfbff6 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: "" From 1f4aa93174346c77a38e56faeebc07e413f32e2d Mon Sep 17 00:00:00 2001 From: Ryan MacDonald Date: Thu, 11 Oct 2018 16:47:13 -0400 Subject: [PATCH 5/5] Update main.yml --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 9bfbff6..ff5cd2c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -73,5 +73,5 @@ haproxy_frontends: [] haproxy_listen: [] haproxy_userlists: [] -haproxy_extra_global_options: "" -haproxy_extra_defaults_options: "" +haproxy_extra_global_options: [] +haproxy_extra_defaults_options: []