From 11e2af5b184a9260b31ab3be497cb709f3471cec Mon Sep 17 00:00:00 2001 From: Michal Ptacek Date: Wed, 19 Dec 2018 19:42:03 +0000 Subject: Adding role for application handling this ansible role contains application specific tasks, it is written in generic way and different helm charts can be used as application. In addition operator can provide proprietary pre_install and post_install hooks. Change-Id: Ibe4b330e5a725dde41aca9f6a59d702cfaba6f52 Issue-ID: OOM-1551 Signed-off-by: Michal Ptacek --- ansible/roles/application-install/tasks/install.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'ansible/roles/application-install/tasks/install.yml') diff --git a/ansible/roles/application-install/tasks/install.yml b/ansible/roles/application-install/tasks/install.yml index 54b64439..7ff6b62c 100644 --- a/ansible/roles/application-install/tasks/install.yml +++ b/ansible/roles/application-install/tasks/install.yml @@ -5,9 +5,14 @@ --upgrade --skip-refresh -- name: Wait for helm - wait_for: timeout=10 - delegate_to: localhost +#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" @@ -27,8 +32,10 @@ - name: Helm Make All make: - chdir: "{{ app_helm_charts_directory }}" + chdir: "{{ app_helm_charts_infra_directory }}" target: all + environment: + PATH: "{{ helm_bin_dir }}:{{ ansible_env.PATH }}" - name: Helm Install application {{ app_name }} - command: "helm install {{ helm_repository_name }}/{{ app_helm_chart_name }} --name {{ app_helm_release_name }} --namespace {{ app_kubernetes_namespace }}" + command: "{{ helm_bin_dir }}/helm install {{ helm_repository_name }}/{{ app_helm_chart_name }} --name {{ app_helm_release_name }} --namespace {{ app_kubernetes_namespace }}" -- cgit 1.2.3-korg