add option to download file

This commit is contained in:
nd 2022-10-02 22:03:08 +02:00
parent 8e05ea2749
commit 18998c7e97
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
2 changed files with 13 additions and 0 deletions

View file

@ -9,3 +9,4 @@ files_default:
content: ~
template: ~
template_vars: {}
url: ~

View file

@ -4,6 +4,7 @@
- name: "create file/folder (file module, {{ file.path }})"
when:
- not file.url
- not file.content
- not file.template
file:
@ -18,6 +19,7 @@
when:
- file.content or file.src
- file.state != 'link'
- not file.url
copy:
dest: "{{ file.path }}"
group: "{{ file.group }}"
@ -25,3 +27,13 @@
mode: "{{ file.mode }}"
content: "{{ file.content }}"
src: "{{ file.src }}"
- name: "create file/folder (get_url module, {{ file.path }})"
when:
- file.url
get_url:
url: "{{ file.url }}"
dest: "{{ file.path }}"
group: "{{ file.group }}"
owner: "{{ file.owner }}"
mode: "{{ file.mode }}"