From: Frank Brehm Date: Wed, 26 Aug 2020 11:48:04 +0000 (+0200) Subject: Managing storage cluster in .gitlab-ci.yml X-Git-Tag: 2.2.1~1^2~1^2~2 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=24279d3fd3b8b5b8bb9b2dc7e4594ad75c3a5dba;p=pixelpark%2Fcreate-vmware-tpl.git Managing storage cluster in .gitlab-ci.yml --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 344b70c..163c06b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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}"'