Change variable in Ansible template based on group

前端 未结 4 1344
自闭症患者
自闭症患者 2021-02-05 19:25

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         


        
4条回答
  •  情深已故
    2021-02-05 20:10

    {% 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

提交回复
热议问题