tasks/main.yml:
- name: configure
template:
src: haproxy.cfg.j2
dest: /etc/haproxy/haproxy.cfg
owner: root
group: root
mode: 0644
notify: reload haproxy
...
backend refinery
{% for backend in haproxy_backends %}
{{ backend }}
{% endfor %}
...
...
haproxy_stats: true
haproxy_backends:
- 'server refinery01 192.168.5.41:8080 check'
- 'server refinery02 192.168.5.42:8080 check'
...