From b3a62aa9d8651351bee6ce9e03daf16d0209a079 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Mon, 3 May 2021 18:02:57 +0200 Subject: [PATCH] haproxy: use loop syntax instead of with_first_found --- haproxy/tasks/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/haproxy/tasks/main.yml b/haproxy/tasks/main.yml index 972429c4..9e6936b5 100644 --- a/haproxy/tasks/main.yml +++ b/haproxy/tasks/main.yml @@ -100,9 +100,11 @@ dest: /etc/haproxy/haproxy.cfg force: "{{ haproxy_force_config }}" validate: "haproxy -c -f %s" - with_first_found: + loop: "{{ query('first_found', templates) }}" + vars: + templates: - "templates/haproxy/haproxy.{{ inventory_hostname }}.cfg.j2" - - "templates/haproxy/haproxy.{{ host_group }}.cfg.j2" + - "templates/haproxy/haproxy.{{ host_group | default('all') }}.cfg.j2" - "templates/haproxy/haproxy.default.cfg.j2" - "haproxy.default.cfg.j2" notify: reload haproxy