diff --git a/roles/gluster/client/templates/client.config b/roles/gluster/client/templates/client.config index 6584efc924..430964208a 100644 --- a/roles/gluster/client/templates/client.config +++ b/roles/gluster/client/templates/client.config @@ -17,8 +17,8 @@ end-volume volume mirror-0 type cluster/replicate subvolumes {% for server in servers %}vol-#{{loop.index}} {% endfor %} - {% if servers.index(ansible_ssh_host) %} - option read-subvolume vol-{{ servers.index(ansible_ssh_host)}} + {% if servers.index(hostvars[inventory_hostname]['ansible_ssh_host']) %} + option read-subvolume vol-{{ servers.index(hostvars[inventory_hostname]['ansible_ssh_host'])}} {% endif %} end-volume