From 099d133e8bf1fd091adfdb2c48b7b84033693b8e Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 8 Apr 2020 19:20:09 +0200 Subject: [PATCH] Update csi script --- bin/update_csi.sh | 3 +++ tasks/csi.yml | 4 ++-- tasks/main.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/update_csi.sh b/bin/update_csi.sh index f9f30cc..c8cbf80 100755 --- a/bin/update_csi.sh +++ b/bin/update_csi.sh @@ -4,6 +4,9 @@ cd "$(dirname ${0})"/../files/ wget https://github.com/jetstack/cert-manager-csi/raw/master/deploy/cert-manager-csi-driver.yaml kubernetes-split-yaml cert-manager-csi-driver.yaml > generated.log +if [ -d csi ]; then + rm -fr csi +fi mv generated csi cat generated.log | while read LIGNE; do if [ $(echo "${LIGNE}" | grep -c ^File) -eq 1 ]; then echo -n "${LIGNE} "; else echo "${LIGNE}"; fi; done | grep ^File | sort -V | sed 's|.*\(generated/\)\(.*\.yaml\)| - "csi/\2"|' diff --git a/tasks/csi.yml b/tasks/csi.yml index b723ae4..9fee926 100644 --- a/tasks/csi.yml +++ b/tasks/csi.yml @@ -2,12 +2,12 @@ - set_fact: certmanager_csi_state: "present" when: - - certmanager_csi + - certmanager_csi|bool - set_fact: certmanager_csi_state: "absent" when: - - not certmanager_csi + - not certmanager_csi|bool - name: Cert Manager files version {{ certmanager_version }} need to be {{ certmanager_csi_state }} k8s: diff --git a/tasks/main.yml b/tasks/main.yml index a3609c5..6665469 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -59,4 +59,4 @@ include_tasks: "csi.yml" when: - certmanager_csi - tags: certmanager + tags: certmanager|bool