when ... is defined not woring as expected?

Hi there!

ansible-playbook (v. 2.2.0.0) throws an error message that I do not
understand in my conext: "'pkg_repo_list' is undefined"

The task reads:

when executes for each item in the loop and cannot short circuit the with_ as documented here http://docs.ansible.com/ansible/playbooks_conditionals.html#loops-and-conditionals

Hi Brian,

thanks a lot for the pointer / the solution. A double-default does the
trick in this case :slight_smile:

with_items: "{{ (pkg_repo_list|default({})).repo_keys | default() }}"

Cheers, Kai