2017-10-19 08:17:11 +00:00
|
|
|
---
|
2017-10-25 10:45:54 +00:00
|
|
|
- name: file_download | Downloading...
|
|
|
|
debug:
|
|
|
|
msg:
|
|
|
|
- "URL: {{ download.url }}"
|
|
|
|
- "Dest: {{ download.dest }}"
|
|
|
|
|
2017-10-19 08:17:11 +00:00
|
|
|
- name: file_download | Create dest directory
|
|
|
|
file:
|
2018-10-20 11:56:55 +00:00
|
|
|
path: "{{download.dest|dirname}}"
|
2017-10-19 08:17:11 +00:00
|
|
|
state: directory
|
|
|
|
recurse: yes
|
|
|
|
when:
|
|
|
|
- download.enabled
|
|
|
|
- download.file
|
2018-03-31 02:40:01 +00:00
|
|
|
- group_names | intersect(download.groups) | length
|
2017-10-19 08:17:11 +00:00
|
|
|
|
|
|
|
- name: file_download | Download item
|
|
|
|
get_url:
|
|
|
|
url: "{{download.url}}"
|
2018-10-20 11:56:55 +00:00
|
|
|
dest: "{{download.dest}}"
|
2017-10-19 08:17:11 +00:00
|
|
|
sha256sum: "{{download.sha256 | default(omit)}}"
|
|
|
|
owner: "{{ download.owner|default(omit) }}"
|
|
|
|
mode: "{{ download.mode|default(omit) }}"
|
2018-09-21 09:51:17 +00:00
|
|
|
validate_certs: "{{ download_validate_certs }}"
|
2019-01-09 01:36:13 +00:00
|
|
|
url_username: "{{ download.username|default(omit) }}"
|
|
|
|
url_password: "{{ download.password|default(omit) }}"
|
|
|
|
force_basic_auth: "{{ download.force_basic_auth|default(omit) }}"
|
2017-10-19 08:17:11 +00:00
|
|
|
register: get_url_result
|
|
|
|
until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg"
|
|
|
|
retries: 4
|
2018-10-20 11:56:55 +00:00
|
|
|
delay: "{{ retry_stagger | default(5) }}"
|
2017-10-19 08:17:11 +00:00
|
|
|
when:
|
|
|
|
- download.enabled
|
|
|
|
- download.file
|
2018-03-31 02:40:01 +00:00
|
|
|
- group_names | intersect(download.groups) | length
|
2017-10-19 08:17:11 +00:00
|
|
|
|
|
|
|
- name: file_download | Extract archives
|
|
|
|
unarchive:
|
2018-10-20 11:56:55 +00:00
|
|
|
src: "{{download.dest}}"
|
|
|
|
dest: "{{download.dest|dirname}}"
|
2017-10-19 08:17:11 +00:00
|
|
|
owner: "{{ download.owner|default(omit) }}"
|
|
|
|
mode: "{{ download.mode|default(omit) }}"
|
|
|
|
copy: no
|
|
|
|
when:
|
|
|
|
- download.enabled
|
|
|
|
- download.file
|
|
|
|
- download.unarchive|default(False)
|
2018-03-31 02:40:01 +00:00
|
|
|
- group_names | intersect(download.groups) | length
|