Use some hostvars trickery.

This commit is contained in:
Ralph Bean 2014-02-07 22:02:16 +00:00
parent ff73e633e8
commit 75799a5f32

View file

@ -17,8 +17,8 @@ end-volume
volume mirror-0 volume mirror-0
type cluster/replicate type cluster/replicate
subvolumes {% for server in servers %}vol-#{{loop.index}} {% endfor %} subvolumes {% for server in servers %}vol-#{{loop.index}} {% endfor %}
{% if servers.index(ansible_ssh_host) %} {% if servers.index(hostvars[inventory_hostname]['ansible_ssh_host']) %}
option read-subvolume vol-{{ servers.index(ansible_ssh_host)}} option read-subvolume vol-{{ servers.index(hostvars[inventory_hostname]['ansible_ssh_host'])}}
{% endif %} {% endif %}
end-volume end-volume