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.

28 lines
810 B

  1. #!/bin/sh
  2. set -eo pipefail
  3. VERSIONS="$@"
  4. ARCHITECTURES="arm arm64 amd64"
  5. DOWNLOADS="kubelet kubectl kubeadm"
  6. DOWNLOAD_DIR="tmp/kubeadm_hasher"
  7. if [ -z "$VERSIONS" ]; then
  8. echo "USAGE: $0 <versions>"
  9. exit 1
  10. fi
  11. mkdir -p ${DOWNLOAD_DIR}
  12. for download in ${DOWNLOADS}; do
  13. echo -e "\n\n${download}_checksums:"
  14. for arch in ${ARCHITECTURES}; do
  15. echo -e " ${arch}:"
  16. for version in ${VERSIONS}; do
  17. TARGET="${DOWNLOAD_DIR}/${download}-$version-$arch"
  18. if [ ! -f ${TARGET} ]; then
  19. curl -L -f -S -s -o ${TARGET} "https://storage.googleapis.com/kubernetes-release/release/${version}/bin/linux/${arch}/${download}"
  20. fi
  21. echo -e " ${version}: $(sha256sum ${TARGET} | awk '{print $1}')"
  22. done
  23. done
  24. done
  25. echo -e "\n\nAdd these values to roles/download/defaults/main.yml"