ansible version 1.9.1
cat files.yml
tasks:
- name: stat files
stat: path=~/{{ item }}
register: {{ item }}.stat
with_items:
- foo.zip
- bar.zip
- name: copy files
copy: src=~/{{ item }} dest=/tmp/{{ item }}
register: {{ item }}.result
when: {{ item }}.stat.stat.exists == False
with_items:
- foo.zip
- bar.zip
- name: unzip files
shell: cd /tmp/ && unzip -o {{ item }}
when: {{ item }}.result|changed == True
with_items:
- foo.zip
- bar.zip
ERROR: Syntax Error while loading YAML script
If so, how?