From 0e67960f64a02b66b77f1f3d01025133a4a7916b Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Mon, 20 Apr 2020 20:07:55 -0400 Subject: [PATCH] helm-template: enable using values file This patch allows the user to use a provided values file when running the helm-template role. Change-Id: I8e0988c8ec58a33228a326145458a9a0fca323a0 --- roles/helm-template/README.rst | 4 ++++ roles/helm-template/tasks/main.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/helm-template/README.rst b/roles/helm-template/README.rst index 2e241bf6d..8b3139830 100644 --- a/roles/helm-template/README.rst +++ b/roles/helm-template/README.rst @@ -17,6 +17,10 @@ already setup and the Helm executable is installed. Determine if the role should wait for all pods to go up after it applies the template. +.. zuul:rolevar:: helm_values_file + + File containing Helm values to use when templating. + .. zuul:rolevar:: zuul_work_dir :default: {{ zuul.project.src_dir }} diff --git a/roles/helm-template/tasks/main.yaml b/roles/helm-template/tasks/main.yaml index aa146e92d..6eb052aae 100644 --- a/roles/helm-template/tasks/main.yaml +++ b/roles/helm-template/tasks/main.yaml @@ -11,7 +11,7 @@ - name: Deploy templated charts shell: | set -o pipefail - helm template -n {{ helm_release_name }} {{ helm_chart }} | kubectl apply -f- + helm template {% if helm_values_file %}--values {{ helm_values_file }} {% endif %}-n {{ helm_release_name }} {{ helm_chart }} | kubectl apply -f- args: executable: /bin/bash chdir: "{{ zuul_work_dir }}"