I\'ve got an Ansible inventory file a bit like this:
[es-masters] host1.my-network.com [es-slaves] host2.my-network.com host3.my-network.com [es:children] es-m
{% if ansible_fqdn in groups['es-masters'] %} {% set node_master=true %} {% else %} {% set node_master=false %} {% endif %}
maybe like this? change the var which named node_master, rather than use a txt
node_master