{% if rabbitmq_conf is defined %} {{ rabbitmq_conf }} {% endif %} {% if rabbitmq_cluster %} {% for host in ansible_play_hosts %} cluster_formation.classic_config.nodes.{{ loop.index }} = rabbit@{{ hostvars[host].ansible_hostname }} {% endfor %} {% endif %}