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.

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