c12s-kubespray/roles/uploads/tasks/main.yml

45 lines
1.3 KiB
YAML
Raw Normal View History

2016-03-04 16:39:02 +00:00
---
2016-06-26 19:14:45 +00:00
- include_vars: "kube_versions.yml"
- name: Create the checksum file
lineinfile:
create: yes
dest: "{{ role_path }}/{{ kube_version }}_k8s-sha256"
line: '{{item.name}}:{{item.sha256}}'
with_items: '{{downloads}}'
when: item.name in ["kubernetes-kubelet", "kubernetes-kubectl", "kubernetes-apiserver"]
- name: Upload checksum file on GS
gc_storage:
bucket: kargo
object: "{{ kube_version }}_k8s-sha256"
src: "{{ role_path }}/{{ kube_version }}_k8s-sha256"
mode: put
permission: public-read
gs_access_key: "changeme"
gs_secret_key: "changeme"
2016-03-04 16:39:02 +00:00
- name: Create dest directories
file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes
2016-04-11 10:19:09 +00:00
with_items: '{{downloads}}'
2016-03-04 16:39:02 +00:00
- name: Download items
get_url:
url: "{{item.source_url}}"
dest: "{{local_release_dir}}/{{item.dest}}"
sha256sum: "{{item.sha256 | default(omit)}}"
owner: "{{ item.owner|default(omit) }}"
mode: "{{ item.mode|default(omit) }}"
2016-04-11 10:19:09 +00:00
with_items: '{{downloads}}'
2016-03-04 16:39:02 +00:00
- name: uploads items
gc_storage:
bucket: kargo
2016-03-04 16:39:02 +00:00
object: "{{item.version}}_{{item.name}}"
src: "{{ local_release_dir }}/{{item.dest}}"
mode: put
permission: public-read
gs_access_key: "changeme"
gs_secret_key: "changeme"
2016-04-11 10:19:09 +00:00
with_items: '{{downloads}}'