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.

42 lines
1.2 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. - name: file_download | Download item
  16. get_url:
  17. url: "{{download.url}}"
  18. dest: "{{local_release_dir}}/{{download.dest}}"
  19. sha256sum: "{{download.sha256 | default(omit)}}"
  20. owner: "{{ download.owner|default(omit) }}"
  21. mode: "{{ download.mode|default(omit) }}"
  22. register: get_url_result
  23. until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg"
  24. retries: 4
  25. delay: "{{ retry_stagger | random + 3 }}"
  26. when:
  27. - download.enabled
  28. - download.file
  29. - name: file_download | Extract archives
  30. unarchive:
  31. src: "{{ local_release_dir }}/{{download.dest}}"
  32. dest: "{{ local_release_dir }}/{{download.dest|dirname}}"
  33. owner: "{{ download.owner|default(omit) }}"
  34. mode: "{{ download.mode|default(omit) }}"
  35. copy: no
  36. when:
  37. - download.enabled
  38. - download.file
  39. - download.unarchive|default(False)