21165: Adds extra state to uninstall wb1's package from workbench node.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 14 Mar 2024 19:33:33 +0000 (16:33 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 14 Mar 2024 19:33:33 +0000 (16:33 -0300)
I opted for specifically uninstalling the package instead of adding the
arvados.workbench.package.clean state, because that state also removes
packages that might be needed for other services.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/config_examples/multi_host/aws/states/workbench1_uninstall.sls [new file with mode: 0644]
tools/salt-install/provision.sh

diff --git a/tools/salt-install/config_examples/multi_host/aws/states/workbench1_uninstall.sls b/tools/salt-install/config_examples/multi_host/aws/states/workbench1_uninstall.sls
new file mode 100644 (file)
index 0000000..02ac0af
--- /dev/null
@@ -0,0 +1,12 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+{%- set curr_tpldir = tpldir %}
+{%- set tpldir = 'arvados' %}
+{%- from "arvados/map.jinja" import arvados with context %}
+{%- set tpldir = curr_tpldir %}
+
+workbench1_pkg_removed:
+  pkg.removed:
+    - name: {{ arvados.workbench.pkg.name }}
\ No newline at end of file
index bb95b2702aca0771cb2faaed9d44f5792c80f99d..1c3a37fd53e133929a2e49d3fff6304c18a5edca 100755 (executable)
@@ -915,6 +915,10 @@ else
         if [[ "${R}" != "webshell" && "${R}" != "workbench" ]]; then
           grep -q "arvados.${R}" ${STATES_TOP} || echo "    - arvados.${R}" >> ${STATES_TOP}
         fi
+        # Make sure wb1's package get uninstalled
+        if [[ "${R}" == "workbench" ]]; then
+          grep -q "workbench1_uninstall" ${STATES_TOP} || echo "    - extra.workbench1_uninstall" >> ${STATES_TOP}
+        fi
 
         ### Pillars ###
         grep -q "nginx_${R}_configuration" ${PILLARS_TOP} || echo "    - nginx_${R}_configuration" >> ${PILLARS_TOP}