Re: [ansible-project] Ansible: How to use a Variable as an Index?

2015-08-12 Thread lilferna
Hello, That was indeed the problem!! The play works great now. Thanks so much for your help everyone. It would be excellent if we could also add a note to the docs about nested moustaches. Thanks again, Lilian On Wednesday, August 12, 2015 at 12:37:56 PM UTC-7, Brian Coca wrote: also,

Re: [ansible-project] Ansible: How to use a Variable as an Index?

2015-08-12 Thread lilferna
Hi Guys, Thank you for the responses. I should have mentioned this - I had already tried several combinations (including the suggestion above) with and without nested {{ }}, but still can't get a working syntax. Please see below for some attempts and their results. Putting an example/note in

Re: [ansible-project] Ansible: How to use a Variable as an Index?

2015-08-12 Thread lilferna
Let me paste the output of all files the invoking call again here: # ansible-playbook test.yml --extra-vars num=0 [SNIP] TASK: [Static IP Case - Find out Static Overlay IP] *** fatal: [127.0.0.1] = One or more undefined variables: 'list object' has no attribute u'0' #

[ansible-project] Ansible: How to use a Variable as an Index?

2015-08-11 Thread lilferna
Hi Ansible Users, I am trying to use a variable passed in via --extra-vars to index into 'nics' which is defined in nics.yml. It works fine in the when clause, but not in the set_fact. Any suggestions? Thanks, Lilian host# cat nics.yml --- nics: - {type: 'static', ip: '10.3.5.4'} - {type: