You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

  1. ---
  2. - name: file_download | Downloading...
  3. debug:
  4. msg:
  5. - "URL: {{ download.url }}"
  6. - "Dest: {{ download.dest }}"
  7. - name: file_download | Create dest directory
  8. file:
  9. path: "{{local_release_dir}}/{{download.dest|dirname}}"
  10. state: directory
  11. recurse: yes
  12. when:
  13. - download.enabled
  14. - download.file
  15. - group_names | intersect(download.groups) | length
  16. - name: file_download | Download item
  17. get_url:
  18. url: "{{download.url}}"
  19. dest: "{{local_release_dir}}/{{download.dest}}"
  20. sha256sum: "{{download.sha256 | default(omit)}}"
  21. owner: "{{ download.owner|default(omit) }}"
  22. mode: "{{ download.mode|default(omit) }}"
  23. register: get_url_result
  24. until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg"
  25. retries: 4
  26. delay: "{{ retry_stagger | random + 3 }}"
  27. when:
  28. - download.enabled
  29. - download.file
  30. - group_names | intersect(download.groups) | length
  31. - name: file_download | Extract archives
  32. unarchive:
  33. src: "{{ local_release_dir }}/{{download.dest}}"
  34. dest: "{{ local_release_dir }}/{{download.dest|dirname}}"
  35. owner: "{{ download.owner|default(omit) }}"
  36. mode: "{{ download.mode|default(omit) }}"
  37. copy: no
  38. when:
  39. - download.enabled
  40. - download.file
  41. - download.unarchive|default(False)
  42. - group_names | intersect(download.groups) | length