*ping* - any advice on passing variables from one role to another? On Tuesday, November 25, 2014 8:58:49 AM UTC-6, Ananda Debnath wrote: > > 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/7c26bcc7-4324-4549-a2b2-ba1f6825e9c5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
