main.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Helm - add Polyaxon repo
  16. command: "helm repo add polyaxon '{{ polyaxon_helm_chart_repo }}'"
  17. changed_when: true
  18. - name: Helm - update repo
  19. command: helm repo update
  20. changed_when: true
  21. #- name: Copy Polyaxon custom config file
  22. #copy:
  23. #src: polyaxon_config.yaml
  24. #dest: "{{ polyaxon_config_file_dest }}"
  25. #owner: root
  26. #group: root
  27. #mode: "{{ polyaxon_config_file_mode }}"
  28. - name: Polyaxon deploy
  29. block:
  30. - name: Polyaxon deploy
  31. command: >
  32. helm upgrade --cleanup-on-fail \
  33. --install {{ polyaxon_namespace }} polyaxon/polyaxon \
  34. --namespace {{ polyaxon_namespace }} \
  35. --create-namespace \
  36. --version {{ helm_chart_version }} \
  37. # --values {{ polyaxon_config_file_dest }} \
  38. --timeout {{ timeout_min_sec }}
  39. register: deployment_output
  40. rescue:
  41. - name: Polyaxon deployment error
  42. debug:
  43. msg: "Previous Polyaxon deployment is in progress"
  44. when: "'another operation (install/upgrade/rollback) is in progress' in deployment_output.stderr"
  45. - name: Delete existing release
  46. command: helm delete '{{ polyaxon_namespace }}'
  47. - name: Polyaxon deploy
  48. command: >
  49. helm upgrade --cleanup-on-fail \
  50. --install {{ polyaxon_namespace }} polyaxon/polyaxon \
  51. --namespace {{ polyaxon_namespace }} \
  52. --create-namespace \
  53. --version {{ helm_chart_version }} \
  54. # --values {{ polyaxon_config_file_dest }} \
  55. --timeout {{ timeout_min_sec }}