Thanks James.

I understand the recommendation - I'll look into decoupling one of these 
days. For now though, I have a hard dependency - inventory-vm-A/role-A is 
generating a signed cloudfront url (using aws creds that exist in vm-A) 
that needs to be downloaded by inventory-vm-B/role-B without needing to 
ship aws credentials to vm-B - and all of it needs to run in the same play.

I can't seem to be able to access registered variables directly though - if 
I call debug on the registered variable carrying the cloudfront URL within 
any other task item in role-A, it works fine. Calling debug on the same var 
in role-B (which is running on inventory vm-B) in the same play (i.e. 
listed sequentially within the same site.yml file) - shows a blank value. 
The only way I've been able to access it is by using 
hostvars[vm-A][reg-var-name]. Simply using "{{ reg-var-name }}" only works 
in role-A tasks and not role-B tasks.

I'm using Ansible 1.7.2 on Ubuntu 14.04.


On Monday, December 1, 2014 4:32:15 PM UTC-6, James Cammarata wrote:
>
> Hi Ananda, 
>
> Registered variables are available in the global scope and can be accessed 
> by any roles within the same play. However, I would recommend against this 
> as it could make your roles very fragile and very tightly coupled, meaning 
> their reusability would be limited. It sounds like this functionality 
> should all be in a single role rather than split into multiples.
>
> Hope that helps!
>
>

-- 
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/714c041c-14aa-4ea6-80a3-2d3de00b5cd5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to