I have the following two statements which have the same when part. The first one is skipped correctly but the second creates an error. It should be skipped also.
`
debug: var=“{{ sites[env].restricted_areas }}”
when: sites[env].restricted_areas is defined
template: src=“apache/site_credentials” dest=“{{ apache_vhost_base_path }}/{{ sites[env].server_name }}/conf/{{ item.area.internal_name }}”
with_items: sites[env].restricted_areas | list
when: sites[env].restricted_areas is defined
tags: create
TASK: [website | template src=“apache/site_credentials” dest=“{{apache_vhost_base_path}}/{{sites[env].server_name}}/conf/{{item.area.internal_name}}”] ***
fatal: [TSSDMZPORTAL002] => with_items expects a list or a set
`