I have a task with equal below, but when I validate it is defined it not recognized.
- name: include vars virtual_machine
include_tasks: virtual_machine.yml
when:
- gms_az_vm_action == 'create_virtual_machine'
- virtual_machine is defined
loop: "{{ virtual_machine|dict2items }}"
How I do for doesn't read loop and not stop playbook when virtual_machine not defined?