copy file if file.src is given

This commit is contained in:
psy 2020-10-27 13:03:04 +01:00
parent f4687935ad
commit 13184fdcca
No known key found for this signature in database
GPG key ID: DFF5B17AC3A8ECF5

View file

@ -15,6 +15,7 @@
when: when:
- not file.content - not file.content
- not file.template - not file.template
- not file.src
file: file:
path: "{{ file.path }}" path: "{{ file.path }}"
group: "{{ file.group }}" group: "{{ file.group }}"
@ -31,3 +32,13 @@
owner: "{{ file.owner }}" owner: "{{ file.owner }}"
mode: "{{ file.mode }}" mode: "{{ file.mode }}"
content: "{{ file.content }}" content: "{{ file.content }}"
- name: create file/folder
when:
- file.src
copy:
dest: "{{ file.path }}"
group: "{{ file.group }}"
owner: "{{ file.owner }}"
mode: "{{ file.mode }}"
src: "{{ file.src }}"