kubespray/roles/download/tasks/main.yml

33 lines
1.0 KiB
YAML
Raw Normal View History

2015-10-04 04:19:50 +08:00
---
2015-12-31 23:05:25 +08:00
- name: Create dest directories
file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes
with_items: "{{ downloads }}"
2015-12-31 23:05:25 +08:00
- name: Download items
get_url:
url: "{{item.url}}"
dest: "{{local_release_dir}}/{{item.dest}}"
sha256sum: "{{item.sha256 | default(omit)}}"
2016-01-22 23:37:07 +08:00
owner: "{{ item.owner|default(omit) }}"
mode: "{{ item.mode|default(omit) }}"
with_items: "{{ downloads }}"
2015-12-31 23:05:25 +08:00
- name: Extract archives
unarchive:
src: "{{ local_release_dir }}/{{item.dest}}"
dest: "{{ local_release_dir }}/{{item.dest|dirname}}"
2016-01-26 19:17:33 +08:00
owner: "{{ item.owner|default(omit) }}"
mode: "{{ item.mode|default(omit) }}"
copy: no
2015-12-31 23:05:25 +08:00
when: "{{item.unarchive is defined and item.unarchive == True}}"
with_items: "{{ downloads }}"
- 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 }}"