put full dir in file declaration

This commit is contained in:
Cedric Girard 2018-07-27 11:24:52 +02:00
parent 7b27425a89
commit ead97e5fbf
3 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
- name: "Copy two files from {{ dir_src }} to {{ dir_dst }}" - name: "Copy two files from {{ dir_src }} to {{ dir_dst }}"
copy: copy:
src: "{{dir_src}}/{{item}}" src: "{{item}}"
dest: "{{dir_dst}}/" dest: "{{dir_dst}}/"
loop: loop:
- "{{file01}}" - "{{file01}}"

View file

@ -1,6 +1,6 @@
- name: "delete two files in {{ dir_dst }}" - name: "delete two files in {{ dir_dst }}"
file: file:
path: "{{dir_dst}}/{{item}}" path: "{{item}}"
state: absent state: absent
loop: loop:
- "{{file01}}" - "{{file01}}"

View file

@ -1,4 +1,4 @@
dir_src: ~/Images dir_src: /tmp/bar
dir_dst: /tmp/images dir_dst: /tmp/foo
file01: "{{ playbook_dir }}/files/file01.txt" file01: "{{ playbook_dir }}/files/file01.txt"
file02: "{{ playbook_dir }}/files/file02.txt" file02: "{{ playbook_dir }}/files/file02.txt"