Re: [ansible-project] Iterating over parts complex data structures while still referring to other parts of the structure

2019-06-11 Thread Josh Smift
Awesome, that works (with my var as-is -- it'd be a pain to rewrite it) -- thanks! Unfortunately, (a) it's actually even more complicated than that, I forgot a level; and (b) I'm having a hard time figuring out exactly how subelements works to extend this myself. :^p If you don't mind a stupid

Re: [ansible-project] Iterating over parts complex data structures while still referring to other parts of the structure

2019-06-10 Thread Matt Martz
It would be easier to rewrite your var to something like: part: - name: eyes where: faces colors: - blue - brown - green And then use: - debug: msg: "{{ item.0.name }}_{{ item.1 }}" loop: "{{ part|subelements('colors') }}"

[ansible-project] Iterating over parts complex data structures while still referring to other parts of the structure

2019-06-10 Thread Josh Smift
I have a data structure like this: part: eyes: where: faces colors: - blue - brown - green hair: where: heads colors: - black - blond - brown - red toenails: where: feet colors: - pink - red - teal I want to