From fd57fde07582cb8714d0f1051d18d56fdd058381 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Mon, 3 Sep 2018 10:51:55 +0300 Subject: [PATCH] Always run helm init to allow for settings changes --- roles/kubernetes-apps/helm/tasks/main.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes-apps/helm/tasks/main.yml b/roles/kubernetes-apps/helm/tasks/main.yml index 73b0be0cf..da02f9ace 100644 --- a/roles/kubernetes-apps/helm/tasks/main.yml +++ b/roles/kubernetes-apps/helm/tasks/main.yml @@ -36,7 +36,22 @@ {% if tiller_node_selectors is defined %} --node-selectors {{ tiller_node_selectors }}{% endif %} {% if tiller_override is defined %} --override {{ tiller_override }}{% endif %} {% if tiller_max_history is defined %} --history-max={{ tiller_max_history }}{% endif %} - when: (helm_container is defined and helm_container.changed) or (helm_task_result is defined and helm_task_result.changed) + register: install_helm + changed_when: false + +#FIXME: https://github.com/helm/helm/issues/4063 +- name: Helm | Force apply tiller overrides if necessary + shell: > + {{ bin_dir }}/helm init --upgrade --tiller-image={{ tiller_image_repo }}:{{ tiller_image_tag }} --tiller-namespace={{ tiller_namespace }} + {% if helm_skip_refresh %} --skip-refresh{% endif %} + {% if helm_stable_repo_url is defined %} --stable-repo-url {{ helm_stable_repo_url }}{% endif %} + {% if rbac_enabled %} --service-account=tiller{% endif %} + {% if tiller_node_selectors is defined %} --node-selectors {{ tiller_node_selectors }}{% endif %} + {% if tiller_override is defined %} --override {{ tiller_override }}{% endif %} + {% if tiller_max_history is defined %} --history-max={{ tiller_max_history }}{% endif %} + | kubectl apply -f - + changed_when: false + when: tiller_override is defined - name: Helm | Set up bash completion shell: "umask 022 && {{ bin_dir }}/helm completion bash >/etc/bash_completion.d/helm.sh"