From 00f6271dd1f66a03ffd03dc3ec5fbc5cd2f90b9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
Date: Wed, 30 Oct 2024 15:14:19 +0000
Subject: [PATCH] Fix behaviour on notebooks deployment errors

Separare deployment of notebooks and monitoring.
---
 common/playbooks/notebooks.yaml | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/common/playbooks/notebooks.yaml b/common/playbooks/notebooks.yaml
index 5b003a7..4c6db4d 100644
--- a/common/playbooks/notebooks.yaml
+++ b/common/playbooks/notebooks.yaml
@@ -36,7 +36,6 @@
       vars:
         name: "{{ item | basename | splitext | first }}"
         version: "3.2.1" # app 4.0.2 (2023-11-27)
-        monitor_version: "0.3.1"
       shell: |-
         helm status --namespace {{ name }} {{ name }}
         if [ $? -ne 0 ]; then
@@ -47,6 +46,17 @@
             helm upgrade --version {{ version }} -f /tmp/{{ item | basename }} --timeout 2h \
                 --namespace {{ name }} {{ name }} jupyterhub/jupyterhub
         fi
+      environment:
+        KUBECONFIG: /etc/kubernetes/admin.conf
+        PATH: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
+      when: true
+      with_fileglob:
+        - "../deployments/*.yaml"
+    - name: Deploy/upgrade notebook monitoring instance
+      vars:
+        name: "{{ item | basename | splitext | first }}"
+        monitor_version: "0.3.1"
+      shell: |-
         helm status --namespace {{ name }} {{ name }}-monitor
         if [ $? -ne 0 ]; then
             helm install --namespace {{ name }} \
@@ -63,7 +73,6 @@
       when: true
       with_fileglob:
         - "../deployments/*.yaml"
-
     - name: Configure secrets management for the hub
       vars:
         name: "{{ item | basename | splitext | first }}"
-- 
GitLab