Karl is correct. Your data structure is making things difficult. If you
make your datastructure a list of dictionaries, you can use the
with_subelements function, described here:
http://docs.ansible.com/playbooks_loops.html#looping-over-subelements
- hosts: localhost
vars:
oracle_app_directory: /app
oracle_db_homes:
- version: 12.1.0
path: "{{ oracle_app_directory }}/oracle/product/12.1.0/dbhome_1"
installation_files_directory: /share/oracle/12.1.0/patches
installation_files:
- linuxamd64_12c_database_1of2.zip
- linuxamd64_12c_database_2of2.zip
unpack_directory: /share/oracle/12.1.0/unpacked
- version: 11.2.0
path: "{{ oracle_app_directory }}/oracle/product/11.2.0/dbhome_1"
installation_files_directory: /share/oracle/11.2.0/patches
installation_files:
- linuxamd64_11g_database_1of2.zip
- linuxamd64_11g_database_2of2.zip
unpack_directory: /share/oracle/11.2.0/unpacked
tasks:
- debug: msg="{{ item.0.version }} -- {{ item.1 }}"
with_subelements:
- oracle_db_homes
- installation_files
On Wednesday, November 19, 2014 8:25:14 AM UTC-5, Thomas Krahn wrote:
>
> Hi Karl,
>
> Thanks for your answer. The name is needed as I need to reference it from
> another data structure. My problem is really not how to loop over a dict.
> My problem is the array installation_files where I need to loop
> additionally.
>
> I need to unpack the installation files for every home ;-)
>
> Thomas
>
>
--
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/203469c8-40dc-44de-9891-d487b92d8e1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.