haproxy: use loop syntax instead of with_first_found

This commit is contained in:
Jérémy Lecour 2021-05-03 18:02:57 +02:00 committed by Jérémy Lecour
parent eacdd2c7f2
commit b3a62aa9d8

View file

@ -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