Re: [ansible-project] Re: How to loop over list while pulling data from different list?

2015-03-06 Thread Jack Martin
Hi Clay, My understanding is that list_of_dict, being a list, should be indexed by integer and not by a string such as 'd01'. Try the code in Chip's response; it runs successfully. Cheers, Jack On Fri, Mar 6, 2015 at 2:25 AM, Clay Ye wrote: > the above code got this error message, how to fix

Re: [ansible-project] Re: How to loop over list while pulling data from different list?

2015-03-06 Thread Clay Ye
the above code got this error message, how to fix it ? TASK: [debug msg="{{ list_of_dict[item] }}"] ** fatal: [localhost] => One or more undefined variables: 'list object' has no attribute 'd01' FATAL: all hosts have already failed -- aborting On Wednesday,

[ansible-project] Re: How to loop over list while pulling data from different list?

2015-03-05 Thread jack . martin8912
That is exactly what I was looking for! Thanks. On Wednesday, March 4, 2015 at 6:58:58 PM UTC-5, Chip Selden wrote: > > Jack, > > Interesting dilemma, I believe a little bit of Jinja2 would help you out. > Try running this: > > - name: Test playbook > hosts: localhost > vars: > list01: >

Re: [ansible-project] Re: How to loop over list while pulling data from different list?

2015-03-04 Thread Brian Coca
have you tried: tasks: - debug: msg="{{ llist_of_dict[item] }}" with_items:"{{list01|union(list02)}}" -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails fr

[ansible-project] Re: How to loop over list while pulling data from different list?

2015-03-04 Thread Chip Selden
Jack, Interesting dilemma, I believe a little bit of Jinja2 would help you out. Try running this: - name: Test playbook hosts: localhost vars: list01: - d01 - d03 - d04 - d06 list02: - d02 - d05 - d06 list_of_dict: - { key: d01, val