You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

  1. ---
  2. - include_vars: "kube_versions.yml"
  3. - name: Create the checksum file
  4. lineinfile:
  5. create: yes
  6. dest: "{{ role_path }}/{{ kube_version }}_k8s-sha256"
  7. line: '{{item.name}}:{{item.sha256}}'
  8. with_items: '{{downloads}}'
  9. when: item.name in ["kubernetes-kubelet", "kubernetes-kubectl", "kubernetes-apiserver"]
  10. - name: Upload checksum file on GS
  11. gc_storage:
  12. bucket: kargo
  13. object: "{{ kube_version }}_k8s-sha256"
  14. src: "{{ role_path }}/{{ kube_version }}_k8s-sha256"
  15. mode: put
  16. permission: public-read
  17. gs_access_key: "changeme"
  18. gs_secret_key: "changeme"
  19. - name: Create dest directories
  20. file: path={{local_release_dir}}/{{item.dest|dirname}} state=directory recurse=yes
  21. with_items: '{{downloads}}'
  22. - name: Download items
  23. get_url:
  24. url: "{{item.source_url}}"
  25. dest: "{{local_release_dir}}/{{item.dest}}"
  26. sha256sum: "{{item.sha256 | default(omit)}}"
  27. owner: "{{ item.owner|default(omit) }}"
  28. mode: "{{ item.mode|default(omit) }}"
  29. with_items: '{{downloads}}'
  30. - name: uploads items
  31. gc_storage:
  32. bucket: kargo
  33. object: "{{item.version}}_{{item.name}}"
  34. src: "{{ local_release_dir }}/{{item.dest}}"
  35. mode: put
  36. permission: public-read
  37. gs_access_key: "changeme"
  38. gs_secret_key: "changeme"
  39. with_items: '{{downloads}}'