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.

57 lines
1.8 KiB

  1. ---
  2. - hosts: localhost
  3. tasks:
  4. - name: CephFS Provisioner | Install pip packages
  5. pip:
  6. name: "{{ item.name }}"
  7. version: "{{ item.version }}"
  8. state: "{{ item.state }}"
  9. extra_args: "{{ pip_extra_args | default(omit) }}"
  10. with_items:
  11. - { state: "present", name: "docker", version: "3.4.1" }
  12. - { state: "present", name: "docker-compose", version: "1.21.2" }
  13. - name: CephFS Provisioner | Check Go version
  14. shell: |
  15. go version
  16. ignore_errors: yes
  17. register: go_version_result
  18. - name: CephFS Provisioner | Install Go 1.9
  19. shell: |
  20. add-apt-repository -y ppa:gophers/archive
  21. apt-get update
  22. apt-get install -y golang-1.9
  23. ln -fs /usr/lib/go-1.9/bin/* /usr/local/bin/
  24. when: 'go_version_result.rc != 0 or "go version go1.9" not in go_version_result.stdout'
  25. - name: CephFS Provisioner | Check if image exists
  26. shell: |
  27. docker image list | grep 'cephfs-provisioner'
  28. ignore_errors: yes
  29. register: check_image_result
  30. - block:
  31. - name: CephFS Provisioner | Clone repo
  32. git:
  33. repo: https://github.com/kubernetes-incubator/external-storage.git
  34. dest: "~/go/src/github.com/kubernetes-incubator/external-storage"
  35. version: 06fddbe2
  36. clone: yes
  37. update: yes
  38. - name: CephFS Provisioner | Build image
  39. shell: |
  40. cd ~/go/src/github.com/kubernetes-incubator/external-storage
  41. REGISTRY=quay.io/kubespray/ VERSION=06fddbe2 make ceph/cephfs
  42. - name: CephFS Provisioner | Push image
  43. docker_image:
  44. name: quay.io/kubespray/cephfs-provisioner:06fddbe2
  45. push: yes
  46. register: docker_image
  47. retries: 10
  48. until: docker_image is succeeded
  49. when: check_image_result.rc != 0