- name: Copying webcontent synchronize: src=some/relative/path/{{ item }} dest=/some/absolute/path/{{ item }} with_items: - some - other---
- name: check file exists
stat:
path: some/relative/path/{{ item }}
with_items:
- some
- other
register: checks
- name: Copying webcontent
synchronize:
src: some/relative/path/{{ item }}
dest: /some/absolute/path/{{ item }}
when: item.stat.exists
with_items: "{{ checks.results }}"