From 05a615b0c05696d46773a1cd986fe10d41592e53 Mon Sep 17 00:00:00 2001 From: Julien5858 <163551601+Julien5858@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:15:29 +0200 Subject: [PATCH] Validating the config file before templating, only for haproxy_mode == system --- tasks/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/config.yml b/tasks/config.yml index ec489fe..2acaec0 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -5,6 +5,8 @@ src: etc/haproxy/haproxy.cfg.j2 dest: "{{ haproxy_config }}" mode: "0640" - # FIXME: find a way to validate in Docker mode + # FIXME: below validate config file when system mode + # need to find a way to validate in Docker mode # validate: "{{ haproxy_bin }} -f %s -c" + validate: "{{ (haproxy_mode == 'system') | ternary(haproxy_bin ~ ' -f %s -c', omit) }}" notify: Reload haproxy