Additional conditions for tasks inside a block
I'm trying to enclose tasks in the block with some when condition. Also some tasks inside this block have additional conditions. The problem is such tasks (with additional conditions) are skipped. Both block's condition and all additional conditions are true. Below there is a sample play: - block: - set_fact: packages_to_install: "{{ packages_to_install }} + [ '{{ (distrs.stdout | from_json).postgresql }}' ]" - set_fact: packages_to_install: "{{ packages_to_install }} + [ '{{ (distrs.stdout | from_json).webserver }}' ]" when: - server.webserver is defined - server.webserver == true when: -