ba615ff94e
using a shared folder can cause race conditions for the download role as it tries to download files on all the nodes to the same shared path. This adds a flag to run the tasks in the download role on just one node.
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
---
|
|
- name: Create dest directories
|
|
file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes
|
|
with_items: "{{ downloads }}"
|
|
run_once: "{{ download_run_once|bool }}"
|
|
|
|
- name: Download items
|
|
get_url:
|
|
url: "{{item.url}}"
|
|
dest: "{{local_release_dir}}/{{item.dest}}"
|
|
sha256sum: "{{item.sha256 | default(omit)}}"
|
|
owner: "{{ item.owner|default(omit) }}"
|
|
mode: "{{ item.mode|default(omit) }}"
|
|
with_items: "{{ downloads }}"
|
|
run_once: "{{ download_run_once|bool }}"
|
|
|
|
- name: Extract archives
|
|
unarchive:
|
|
src: "{{ local_release_dir }}/{{item.dest}}"
|
|
dest: "{{ local_release_dir }}/{{item.dest|dirname}}"
|
|
owner: "{{ item.owner|default(omit) }}"
|
|
mode: "{{ item.mode|default(omit) }}"
|
|
copy: no
|
|
when: "{{item.unarchive is defined and item.unarchive == True}}"
|
|
with_items: "{{ downloads }}"
|
|
run_once: "{{ download_run_once|bool }}"
|
|
|
|
- name: Fix permissions
|
|
file:
|
|
state: file
|
|
path: "{{local_release_dir}}/{{item.dest}}"
|
|
owner: "{{ item.owner|default(omit) }}"
|
|
mode: "{{ item.mode|default(omit) }}"
|
|
when: "{{item.unarchive is not defined or item.unarchive == False}}"
|
|
with_items: "{{ downloads }}"
|
|
run_once: "{{ download_run_once|bool }}"
|