blob: eaa40ce2cad82580c629e03b8d74efeb2c9d4567 [file] [log] [blame]
Tomas Levora5ea00a92018-12-19 14:36:36 +01001---
2- name: Helm init and upgrade
3 command: |
4 {{ helm_bin_dir }}/helm init
5 --upgrade
6 --skip-refresh
7
Michal Ptacek11e2af52018-12-19 19:42:03 +00008#A correct way to implement this would be using --wait option in helm init invocation.
9#However, it does not work due to https://github.com/helm/helm/issues/4031 (fixed in newer helm release)
10- name: "Wait for helm upgrade to finish"
11 command: "{{ helm_bin_dir }}/helm version --tiller-connection-timeout 10"
12 register: result
13 until: result.rc == 0
14 delay: 10
15 retries: 12
Tomas Levora5ea00a92018-12-19 14:36:36 +010016
17- name: Get all helm repos
18 command: "{{ helm_bin_dir }}/helm repo list"
19 register: repos
20
21- name: Remove stable repo
22 command: "{{ helm_bin_dir }}/helm repo remove stable"
23 when: "'stable' in repos.stdout"
24
25- name: Helm Serve
26 shell: "{{ helm_bin_dir }}/helm serve &"
27 async: 45
28 poll: 0
29
30- name: Helm Add Repo
31 command: "{{ helm_bin_dir }}/helm repo add {{ helm_repository_name }} {{ helm_repository_url }}"
32
Michal Ptacek271cf3f2019-01-17 20:39:46 +000033- name: Build local helm repository
Tomas Levora5ea00a92018-12-19 14:36:36 +010034 make:
Michal Ptacek11e2af52018-12-19 19:42:03 +000035 chdir: "{{ app_helm_charts_infra_directory }}"
Michal Ptacek271cf3f2019-01-17 20:39:46 +000036 target: "{{ item }}"
37 with_items: "{{ app_helm_build_targets }}"
Michal Ptacek11e2af52018-12-19 19:42:03 +000038 environment:
39 PATH: "{{ helm_bin_dir }}:{{ ansible_env.PATH }}"
Tomas Levora5ea00a92018-12-19 14:36:36 +010040
Michal Ptacekfabcad62019-02-04 06:38:08 +000041- name: Check for deploy plugin presence
42 stat:
43 path: '~/.helm/plugins/deploy/deploy.sh'
44 register: deploy_plugin_presence
45
46- name: "Helm Install application {{ app_name }}"
47 command: >
48 {{ helm_bin_dir }}/helm
49 {{ 'deploy' if deploy_plugin_presence.stat.exists else 'install --name' }}
50 {{ app_helm_release_name }}
51 {{ helm_repository_name }}/{{ app_helm_chart_name }}
52 --namespace {{ app_kubernetes_namespace }}