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

42 lines
1.2 KiB
YAML

---
- 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"
- name: Create dest directories
file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes
with_items: '{{downloads}}'
- 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) }}"
with_items: '{{downloads}}'
- name: uploads items
gc_storage:
bucket: kargo
object: "{{item.version}}_{{item.name}}"
src: "{{ local_release_dir }}/{{item.dest}}"
mode: put
permission: public-read
gs_access_key: "changeme"
gs_secret_key: "changeme"
with_items: '{{downloads}}'