Hi,
I have a vars file with the following:
applications:
- name: app1
sublist:
item11
item12
name: app2
sublist:
item21
item22
name: app3
…and a playbook task of:
- debug: msg=“{{ item.0.name }}”
with_subelements:
applications
sublist
… which bombs out on the last application.
I was wondering if there was a more “ansible” (or python) way of having the second key optional for the with_subelements loop.
I’ve unsuccessfully tried adding a 'when: “‘ssl’ in item.0” condition.
TIA,
John