]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Managing storage cluster in .gitlab-ci.yml
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 26 Aug 2020 11:48:04 +0000 (13:48 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 26 Aug 2020 11:48:04 +0000 (13:48 +0200)
.gitlab-ci.yml

index 344b70c8311268eb2d50d218b91a410c3ad86ed3..163c06b63c0b48366f0dff5fe4756ac0ca36aae7 100644 (file)
@@ -17,6 +17,7 @@ variables:
   VSPHERE_API_PASSWD_PROD: 'secret'
   VSPHERE_DC: ''
   VSPHERE_CLUSTER: ''
+  VSPHERE_STORAGE_CLUSTER: ''
   VSPHERE_VM_FOLDER: 'templates'
   MAX_NR_TEMPLATES_STAY: 4
   VMWARE_CONFIG_VERSION: 'vmx-15'
@@ -83,6 +84,13 @@ variables:
                 VSPHERE_CLUSTER="test-vmcc-l105-01";
             fi
         fi'
+    - ' if [ -z "${VSPHERE_STORAGE_CLUSTER}" ] ; then
+            if [ "$CI_COMMIT_REF_NAME" = "master" -o "$CI_COMMIT_REF_NAME" = "production" ] ; then
+                VSPHERE_STORAGE_CLUSTER="ds-cluster-hdd-vmcc-l105-01";
+            else
+                VSPHERE_STORAGE_CLUSTER="Daten-Cluster-Gold_01";
+            fi
+        fi'
     - 'CONFIG_FILE=etc/create-${OS_ID}-${SYSTEM_STATUS}.ini'
     - 'echo "Configuration file: \"${CONFIG_FILE}\""'
     - 'touch "${CONFIG_FILE}"'
@@ -159,6 +167,7 @@ Create OracleLinux7 template:
     - 'echo "dc = ${VSPHERE_DC}" >> "${CONFIG_FILE}"'
     - 'echo "cluster = ${VSPHERE_CLUSTER}" >> "${CONFIG_FILE}"'
     - 'echo "folder = ${VSPHERE_VM_FOLDER}" >> "${CONFIG_FILE}"'
+    - 'echo "storage_cluster = ${VSPHERE_STORAGE_CLUSTER}" >> "${CONFIG_FILE}"'
     - 'echo "max_nr_templates_stay = ${MAX_NR_TEMPLATES_STAY}" >> "${CONFIG_FILE}"'
     - 'echo "" >> "${CONFIG_FILE}"'
     - 'echo "[Template]" >> "${CONFIG_FILE}"'
@@ -230,6 +239,7 @@ Create Centos7 template:
     - 'echo "dc = ${VSPHERE_DC}" >> "${CONFIG_FILE}"'
     - 'echo "cluster = ${VSPHERE_CLUSTER}" >> "${CONFIG_FILE}"'
     - 'echo "folder = ${VSPHERE_VM_FOLDER}" >> "${CONFIG_FILE}"'
+    - 'echo "storage_cluster = ${VSPHERE_STORAGE_CLUSTER}" >> "${CONFIG_FILE}"'
     - 'echo "max_nr_templates_stay = ${MAX_NR_TEMPLATES_STAY}" >> "${CONFIG_FILE}"'
     - 'echo "" >> "${CONFIG_FILE}"'
     - 'echo "[Template]" >> "${CONFIG_FILE}"'
@@ -302,6 +312,7 @@ Create Centos8 template:
     - 'echo "dc = ${VSPHERE_DC}" >> "${CONFIG_FILE}"'
     - 'echo "cluster = ${VSPHERE_CLUSTER}" >> "${CONFIG_FILE}"'
     - 'echo "folder = ${VSPHERE_VM_FOLDER}" >> "${CONFIG_FILE}"'
+    - 'echo "storage_cluster = ${VSPHERE_STORAGE_CLUSTER}" >> "${CONFIG_FILE}"'
     - 'echo "max_nr_templates_stay = ${MAX_NR_TEMPLATES_STAY}" >> "${CONFIG_FILE}"'
     - 'echo "" >> "${CONFIG_FILE}"'
     - 'echo "[Template]" >> "${CONFIG_FILE}"'