Ansible tasks can have when
clauses like this:
- name: Conditional output
debug:
msg: This is a conditional output
when: some_var
In order to protect about some_var
being undefined, one can use
- name: Conditional output
debug:
msg: This is a conditional output
when: some_var is defined and some_var
There also seems to be a variant like this:
- name: Conditional output
debug:
msg: This is a conditional output
when: some_var | d() | bool
Are these variants the same? What are their advantages/disadvantages?