From 75799a5f32115c698543493f1bdf6ff19f53491f Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 7 Feb 2014 22:02:16 +0000 Subject: [PATCH] Use some hostvars trickery. --- roles/gluster/client/templates/client.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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