Use some hostvars trickery.
This commit is contained in:
parent
ff73e633e8
commit
75799a5f32
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue