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



result:

TASK: [website | debug var="{{sites[env].restricted_areas}}"] 
*****************
skipping: [TSSDMZPORTAL002]


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


can someone help me?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/eb330a83-d434-4d8f-8022-0f9acafff636%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to