summaryrefslogtreecommitdiffstats
path: root/ansible/roles/application-install/tasks/install.yml
blob: 7ff6b62c6c2931141ad051afdc58ca3eb05a80a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- name: Helm init and upgrade
  command: |
     {{ helm_bin_dir }}/helm init
     --upgrade
     --skip-refresh

#A correct way to implement this would be using --wait option in helm init invocation.
#However, it does not work due to https://github.com/helm/helm/issues/4031 (fixed in newer helm release)
- name: "Wait for helm upgrade to finish"
  command: "{{ helm_bin_dir }}/helm version --tiller-connection-timeout 10"
  register: result
  until: result.rc == 0
  delay: 10
  retries: 12

- name: Get all helm repos
  command: "{{ helm_bin_dir }}/helm repo list"
  register: repos

- name: Remove stable repo
  command: "{{ helm_bin_dir }}/helm repo remove stable"
  when: "'stable' in repos.stdout"

- name: Helm Serve
  shell: "{{ helm_bin_dir }}/helm serve &"
  async: 45
  poll: 0

- name: Helm Add Repo
  command: "{{ helm_bin_dir }}/helm repo add {{ helm_repository_name }} {{ helm_repository_url }}"

- name: Helm Make All
  make:
    chdir: "{{ app_helm_charts_infra_directory }}"
    target: all
  environment:
    PATH: "{{ helm_bin_dir }}:{{ ansible_env.PATH }}"

- name: Helm Install application {{ app_name }}
  command: "{{ helm_bin_dir }}/helm install {{ helm_repository_name }}/{{ app_helm_chart_name }} --name {{ app_helm_release_name }} --namespace {{ app_kubernetes_namespace }}"