I'm trying to dynamically create a template from a list and I'm wondering if Ansible supports something like
{% for server in [sg-bend1, sg-bend2] %}
check program {{ server }}_test
with path /home/ubuntu/t.sh {{ server }}
if status != 0 then alert
{% endfor %}
theoretically this should produce
check program sg-bend1_test
with path /home/ubuntu/t.sh sg-bend1
if status != 0 then alert
check program sg-bend2_test
with path /home/ubuntu/t.sh sg-bend2
if status != 0 then alert