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.

47 lines
1.7 KiB

9 years ago
  1. ---
  2. - name: Create kubernetes release directory
  3. local_action: file
  4. path={{ local_release_dir }}/kubernetes
  5. state=directory
  6. - name: Check if kubernetes release archive has been downloaded
  7. local_action: stat
  8. path={{ local_release_dir }}/kubernetes/kubernetes.tar.gz
  9. register: k_tar
  10. # issues with get_url module and redirects, to be tested again in the near future
  11. - name: Download kubernetes
  12. local_action: shell
  13. curl -o {{ local_release_dir }}/kubernetes/kubernetes.tar.gz -Ls {{ kube_download_url }}/{{ kube_version }}/kubernetes.tar.gz
  14. when: not k_tar.stat.exists or k_tar.stat.checksum != "{{ kube_sha1 }}"
  15. register: dl_kube
  16. - name: Compare kubernetes archive checksum
  17. local_action: stat
  18. path={{ local_release_dir }}/kubernetes/kubernetes.tar.gz
  19. register: k_tar
  20. failed_when: k_tar.stat.checksum != "{{ kube_sha1 }}"
  21. when: dl_kube|changed
  22. - name: Extract kubernetes archive
  23. local_action: unarchive
  24. src={{ local_release_dir }}/kubernetes/kubernetes.tar.gz
  25. dest={{ local_release_dir }}/kubernetes copy=no
  26. when: dl_kube|changed
  27. - name: Extract kubernetes binaries archive
  28. local_action: unarchive
  29. src={{ local_release_dir }}/kubernetes/kubernetes/server/kubernetes-server-linux-amd64.tar.gz
  30. dest={{ local_release_dir }}/kubernetes copy=no
  31. when: dl_kube|changed
  32. - name: Pick up only kubernetes binaries
  33. local_action: synchronize
  34. src={{ local_release_dir }}/kubernetes/kubernetes/server/bin
  35. dest={{ local_release_dir }}/kubernetes
  36. when: dl_kube|changed
  37. - name: Delete unused kubernetes files
  38. local_action: file
  39. path={{ local_release_dir }}/kubernetes/kubernetes state=absent
  40. when: dl_kube|changed