2015-10-03 20:19:50 +00:00
|
|
|
---
|
2016-06-26 19:14:45 +00:00
|
|
|
- include_vars: kube_versions.yml
|
|
|
|
|
2016-05-22 22:25:52 +00:00
|
|
|
- name: downloading...
|
|
|
|
debug:
|
|
|
|
msg: "{{ download.url }}"
|
2016-09-14 12:30:57 +00:00
|
|
|
when: "{{ download.enabled|bool and not download.container|bool }}"
|
2016-05-22 22:25:52 +00:00
|
|
|
|
2015-12-31 15:05:25 +00:00
|
|
|
- name: Create dest directories
|
2016-05-22 22:25:52 +00:00
|
|
|
file: path={{local_release_dir}}/{{download.dest|dirname}} state=directory recurse=yes
|
2016-09-14 12:30:57 +00:00
|
|
|
when: "{{ download.enabled|bool and not download.container|bool }}"
|
2016-05-18 04:30:01 +00:00
|
|
|
run_once: "{{ download_run_once|bool }}"
|
2015-12-31 15:05:25 +00:00
|
|
|
|
|
|
|
- name: Download items
|
|
|
|
get_url:
|
2016-05-22 22:25:52 +00:00
|
|
|
url: "{{download.url}}"
|
|
|
|
dest: "{{local_release_dir}}/{{download.dest}}"
|
|
|
|
sha256sum: "{{download.sha256 | default(omit)}}"
|
|
|
|
owner: "{{ download.owner|default(omit) }}"
|
|
|
|
mode: "{{ download.mode|default(omit) }}"
|
2016-09-14 12:30:57 +00:00
|
|
|
register: get_url_result
|
|
|
|
until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg"
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ 20 | random + 3 }}"
|
|
|
|
when: "{{ download.enabled|bool and not download.container|bool }}"
|
2016-05-18 04:30:01 +00:00
|
|
|
run_once: "{{ download_run_once|bool }}"
|
2015-12-31 15:05:25 +00:00
|
|
|
|
|
|
|
- name: Extract archives
|
|
|
|
unarchive:
|
2016-05-22 22:25:52 +00:00
|
|
|
src: "{{ local_release_dir }}/{{download.dest}}"
|
|
|
|
dest: "{{ local_release_dir }}/{{download.dest|dirname}}"
|
|
|
|
owner: "{{ download.owner|default(omit) }}"
|
|
|
|
mode: "{{ download.mode|default(omit) }}"
|
2016-01-25 19:30:48 +00:00
|
|
|
copy: no
|
2016-09-14 12:30:57 +00:00
|
|
|
when: "{{ download.enabled|bool and not download.container|bool and download.unarchive is defined and download.unarchive == True }}"
|
2016-05-18 04:30:01 +00:00
|
|
|
run_once: "{{ download_run_once|bool }}"
|
2016-01-25 19:30:48 +00:00
|
|
|
|
|
|
|
- name: Fix permissions
|
|
|
|
file:
|
|
|
|
state: file
|
2016-05-22 22:25:52 +00:00
|
|
|
path: "{{local_release_dir}}/{{download.dest}}"
|
|
|
|
owner: "{{ download.owner|default(omit) }}"
|
|
|
|
mode: "{{ download.mode|default(omit) }}"
|
2016-09-14 12:30:57 +00:00
|
|
|
when: "{{ download.enabled|bool and not download.container|bool and (download.unarchive is not defined or download.unarchive == False) }}"
|
|
|
|
run_once: "{{ download_run_once|bool }}"
|
|
|
|
|
|
|
|
- name: pulling...
|
|
|
|
debug:
|
|
|
|
msg: "{{ download.repo }}:{{ download.tag }}"
|
|
|
|
when: "{{ download.enabled|bool and download.container|bool }}"
|
|
|
|
|
|
|
|
- name: Create dest directory for container images to be saved
|
|
|
|
file: path="{{local_release_dir}}/containers" state=directory recurse=yes
|
|
|
|
when: "{{ download.enabled|bool and download.container|bool }}"
|
|
|
|
run_once: "{{ download_run_once|bool }}"
|
|
|
|
|
|
|
|
#NOTE(bogdando) this brings no docker-py deps for nodes
|
|
|
|
- name: Download containers
|
|
|
|
command: "/usr/bin/docker pull {{ download.repo }}:{{ download.tag }}"
|
|
|
|
register: pull_task_result
|
|
|
|
until: pull_task_result.rc == 0
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ 20 | random + 3 }}"
|
|
|
|
when: "{{ download.enabled|bool and download.container|bool }}"
|
2016-05-18 04:30:01 +00:00
|
|
|
run_once: "{{ download_run_once|bool }}"
|