ho-ansible / xnbd

Ansible role: remote-mounted block device storage
MIT License
0 stars 0 forks source link

hostvars in xnbd-server group #2

Open seanho00 opened 6 years ago

seanho00 commented 6 years ago

Template client.conf fails to get proper VPN IP for each host in xnbd-server group, when role is run from site.yml for a specific client host.

Works when run from plays/xnbd.yml playbook for all xnbd hosts together in same play.

seanho00 commented 6 years ago

When using hostvars to access variables of a host not in the current play, inventory variables are available, but not host facts.

The tinc role (tasks/main.yml for servers) doesn't have this issue, because all the info needed from hosts not in current play is in inventory vars, not host facts.

The issue here is xnbd_address is set (in inventory) to the host's VPN address, which needs to be gleaned from host facts; it is not set in inventory.

seanho00 commented 6 years ago

Facts for hosts not in play should be accessible, because we're using fact caching.

Perhaps it's a one-pass jinja templating issue?

seanho00 commented 5 years ago

xnbd-client task only works properly when all xnbd-servers are in the current play.