interface {{ vars[item.model]['wan'] }} works like a charm. 
Thanks guys! really appreciate!

I was struggling to find the magic predefined variable name to point 
to vars/main.yml.
Where is that documented? I looked here  
<http://docs.ansible.com/ansible/playbooks_variables.html#magic-variables-and-how-to-access-information-about-other-hosts>and
 
here 
<http://stackoverflow.com/questions/18839509/where-can-i-get-a-list-of-ansible-pre-defined-variables>


On Saturday, October 29, 2016 at 10:06:57 PM UTC+11, Kai Stian Olstad wrote:
>
> On 29. okt. 2016 12:42, [email protected] <javascript:> wrote: 
> > Hi 
> > 
> > Still have an error 
> > 
> > *failed: [NRT001] (item={u'model': u'NRT4451', u'hostname': u'NRT001'}) 
> => 
> > {"failed": true, "item": {"hostname": "NRT001", "model": "NRT4451"}, 
> "msg": 
> > "AnsibleUndefinedVariable: 'dict object' has no attribute u'NRT4451'"}* 
>
> Is your variable definition in the roles vars/main.yml, if so this 
> should work. 
>
> interface {{ vars[item.model]['wan'] }} 
>
> -- 
> Kai Stian Olstad 
>

-- 
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/d509dd9b-df29-4168-88d1-f1125b521daf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to