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:
|
|
|
|
path: "{{local_release_dir}}/{{download.dest|dirname}}"
|
|
|
|
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}}"
|
|
|
|
dest: "{{local_release_dir}}/{{download.dest}}"
|
|
|
|
sha256sum: "{{download.sha256 | default(omit)}}"
|
|
|
|
owner: "{{ download.owner|default(omit) }}"
|
|
|
|
mode: "{{ download.mode|default(omit) }}"
|
|
|
|
register: get_url_result
|
|
|
|
until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg"
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
|
|
|
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:
|
|
|
|
src: "{{ local_release_dir }}/{{download.dest}}"
|
|
|
|
dest: "{{ local_release_dir }}/{{download.dest|dirname}}"
|
|
|
|
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
|