]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Generating Configfile for creating VMWare template
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 6 Feb 2019 16:59:33 +0000 (17:59 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 6 Feb 2019 16:59:33 +0000 (17:59 +0100)
.gitlab-ci.yml

index 308b7b98001f886bc32afb1a00ca31a64048f11f..cde94b08940b7568640878c29288365ceca9def8 100644 (file)
@@ -10,6 +10,24 @@ variables:
   FLAKE8_MAX_COMPLEXITY: 20
   FLAKE8_IGNORE_ERRORS: 'E226,E302,E41,E402'
   GIT_SUBMODULE_STRATEGY: 'recursive'
+  VSPHERE_HOST: 'vcs01.ppbrln.internal'
+  VSPHERE_API_PORT: 443
+  VSPHERE_API_USER: 'Administrator@vsphere.local'
+  VSPHERE_API_PASSWD: 'secret'
+  VSPHERE_DC: 'vmcc'
+  VSPHERE_CLUSTER: 'vmcc-l105-01'
+  VSPHERE_VM_FOLDER: 'templates'
+  MAX_NR_TEMPLATES_STAY: 3
+  TEMPLATE_VM_NAME: 'template.pixelpark.com'
+  TEMPLATE_NAME: 'oracle-linux-7-template'
+  VMWARE_CONFIG_VERSION: 'vmx-13'
+  VM_OS_VERSION: 'oracleLinux7_64Guest'
+  VM_DISK_SIZE_GB: 32
+  VM_NUM_CPUS: 2
+  VM_RAM_MB: 4096
+  VM_NETWORK: '192.168.88.0_23'
+  VM_MAC_ADDRESS: '00:16:3e:54:ab:2b'
+  MAX_WAIT_FOR_FINISH_INSTALL: 3600
 
 .template_job: &job_definition
   before_script:
@@ -62,7 +80,31 @@ Deploy OEL7 template image:
     - hostname -f
     - whoami
     - pwd
-    - bin/create-vmware-template --help
+    - rm -fv etc/create.ini
+    - echo '[vSphere]' > etc/create.ini
+    - echo "host = ${VSPHERE_HOST}" >> etc/create.ini
+    - echo "port = ${VSPHERE_API_PORT}" >> etc/create.ini
+    - echo "user = ${VSPHERE_API_USER}" >> etc/create.ini
+    - echo "password = ${VSPHERE_API_PASSWD}" >> etc/create.ini
+    - echo "dc = ${VSPHERE_DC}" >> etc/create.ini
+    - echo "cluster = ${VSPHERE_CLUSTER}" >> etc/create.ini
+    - echo "folder = ${VSPHERE_VM_FOLDER}" >> etc/create.ini
+    - echo "max_nr_templates_stay = ${AX_NR_TEMPLATES_STAY}" >> etc/create.ini
+    - echo "" >> etc/create.ini
+    - echo '[Template]' >> etc/create.ini
+    - echo "vm = ${TEMPLATE_VM_NAME}" >> etc/create.ini
+    - echo "name = ${TEMPLATE_NAME}" >> etc/create.ini
+    - echo "vmware_cfg_version = ${VMWARE_CONFIG_VERSION}" >> etc/create.ini
+    - echo "os_version = ${VM_OS_VERSION}" >> etc/create.ini
+    - echo "data_size_gb = ${VM_DISK_SIZE_GB}" >> etc/create.ini
+    - echo "num_cpus = ${VM_NUM_CPUS}" >> etc/create.ini
+    - echo "ram_mb = ${VM_RAM_MB}" >> etc/create.ini
+    - echo "network = ${VM_NETWORK}" >> etc/create.ini
+    - echo "mac_address = ${VM_MAC_ADDRESS}" >> etc/create.ini
+    - echo "max_wait_for_finish_install = ${MAX_WAIT_FOR_FINISH_INSTALL}" >> etc/create.ini
+    - echo "" >> etc/create.ini
+    - echo "; vim: filetype=dosini" >> etc/create.ini
+    - echo "Generated etc/create.ini:"; cat etc/create.ini; echo "<-- EOF"
   environment:
     name: production
   except: