Hola,

I have a playbook with multiple roles mapped to multiple vms. I'm registering a 
variable in the output of one of the tasks in role A and need to pass it to 
role B. Calling register or set_facts in the role A tasks file works as 
expected within role A, but this var doesn't seem to make it into the tasks 
listed in role B. I finally used hostvars['vmA']['myvar'] to access this 
variable from the tasks of role B. So I suspect I'm missing something about how 
vars are scoped and referenced.

Is hostvars the recommended way to do this or am I missing something obvious?

Thanks,
Ananda

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/09f13d01-8a29-4a9e-acbb-46b3e9711249%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to