From 939485cabf5eb2ce47a052b2cc16a9e3e94afe42 Mon Sep 17 00:00:00 2001
From: handreas <andreas.hamacher@monash.edu>
Date: Sun, 12 Apr 2020 04:46:22 +0000
Subject: [PATCH] reverting heat changes

Former-commit-id: 58c8c19302b72e4af98511e03d408e34946d6b9f
---
 .gitlab-ci.yml                                |  2 +-
 CICD/heat/gc_HOT.yaml                         | 14 ++++++------
 CICD/heat/heatcicdwrapper.sh                  |  9 ++++----
 ...t_parameters_ansible_cluster_in_a_box.yaml | 22 -------------------
 4 files changed, 12 insertions(+), 35 deletions(-)
 delete mode 100644 CICD/heat_parameters_ansible_cluster_in_a_box.yaml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a0a217a1..d3d68ae3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -85,7 +85,7 @@ build_cluster_cicd:
     - echo "heat stage"
     - source ./$NECTAR_ALLOCATION-openrc.sh
     - openstack stack list
-    - bash -x ./heat/heatcicdwrapper.sh create_or_update $STACKNAME ${CI_PROJECT_NAME}
+    - bash -x ./heat/heatcicdwrapper.sh create_or_update $STACKNAME
     - bash -x ./heat/server_rebuild.sh all
   after_script:
     - sleep 30 # artifically wait a bit to give the nodes time to boot
diff --git a/CICD/heat/gc_HOT.yaml b/CICD/heat/gc_HOT.yaml
index cacc7c7c..701fb78f 100644
--- a/CICD/heat/gc_HOT.yaml
+++ b/CICD/heat/gc_HOT.yaml
@@ -117,9 +117,9 @@ resources:
   MgmtNodesCentos7:
    type: "OS::Heat::ResourceGroup"
    properties:
-    count: 0
+    count: 2
     resource_def:
-      type: { get_param: MgmtNodeCountCentos7 }
+      type: My::Server::MgmtNode
       properties:
         #avz: { get_param: avz }
         image: { get_param: centos_7_image_id }
@@ -133,7 +133,7 @@ resources:
   MgmtNodesU:
    type: "OS::Heat::ResourceGroup"
    properties:
-    count: { get_param: MgmtNodeCountUbuntu }
+    count: 0
     resource_def:
       type: My::Server::MgmtNode
       properties:
@@ -149,7 +149,7 @@ resources:
   LoginNodesC:
    type: "OS::Heat::ResourceGroup"
    properties:
-    count: { get_param: LoginNodeCountCentos7 }
+    count: 1
     resource_def:
      type: "OS::Nova::Server"
      properties:
@@ -170,7 +170,7 @@ resources:
   LoginNodesU:
    type: "OS::Heat::ResourceGroup"
    properties:
-    count: { get_param: LoginNodeCountUbuntu }
+    count: 0
     resource_def:
      type: "OS::Nova::Server"
      properties:
@@ -212,7 +212,7 @@ resources:
   ComputeNodesU:
    type: "OS::Heat::ResourceGroup"
    properties:
-    count: { get_param: ComputeNodeCountUbutnu }
+    count: 1
     resource_def:
      type: "OS::Nova::Server"
      properties:
@@ -233,7 +233,7 @@ resources:
   ComputeNodesCentos7:
    type: "OS::Heat::ResourceGroup"
    properties:
-    count: { get_param: ComputeNodeCountCentos7 }
+    count: 1
     resource_def:
      type: "OS::Nova::Server"
      properties:
diff --git a/CICD/heat/heatcicdwrapper.sh b/CICD/heat/heatcicdwrapper.sh
index 60720627..e6554d66 100644
--- a/CICD/heat/heatcicdwrapper.sh
+++ b/CICD/heat/heatcicdwrapper.sh
@@ -4,12 +4,11 @@
 
 
 function usage {
-    echo $"Usage: $0 {create|update|show|create_or_update,delete_if_exists} STACKNAME CI_PROJECT_NAME"
+    echo $"Usage: $0 {create|update|show|create_or_update,delete_if_exists} STACKNAME"
     exit 1
 }
 
 STACKNAME=$2
-CI_PROJECT_NAME=${3:-DEFAULTVALUE} 
 
 if [[ "$STACKNAME" == "CICD"* ]]; then
   echo "CICD found in stackname. doing nothing"
@@ -55,7 +54,7 @@ function create_stack {
     echo "I will NOT create existing stack maybe use update"
     exit -44
  fi
- openstack stack create --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml --parameter-file ./heat_parameters_${CI_PROJECT_NAME}.yaml $STACKNAME
+ openstack stack create --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml $STACKNAME
  createreturn=$?
  if [ $createreturn -ne "0" ]
  then
@@ -78,14 +77,14 @@ case "$1" in
                    echo "I cannot update a stack which does not exist"
                    exit -45
             fi
-            openstack stack update --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml --parameter-file ./heat_parameters_${CI_PROJECT_NAME}.yaml $STACKNAME
+            openstack stack update --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml $STACKNAME
             ret=$?
             exit $ret
             ;;
         create_or_update)
             if  check_stack_exists
                then
-               openstack stack update --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml --parameter-file ./heat_parameters_${CI_PROJECT_NAME}.yaml $STACKNAME
+               openstack stack update --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml $STACKNAME
                ret=$?
                exit $ret
             fi
diff --git a/CICD/heat_parameters_ansible_cluster_in_a_box.yaml b/CICD/heat_parameters_ansible_cluster_in_a_box.yaml
deleted file mode 100644
index 0de87412..00000000
--- a/CICD/heat_parameters_ansible_cluster_in_a_box.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
----
-heat_template_version: 2013-05-23
-
-parameters:
-  MgmtNodeCountUbuntu:
-    type: number
-    default: 1
-  MgmtNodeCountCentos7:
-    type: number
-    default: 1
-  LoginNodeCountCentos7:
-    type: number
-    default: 1
-  LoginNodeCountUbuntu:
-    type: number
-    default: 1
-  ComputeNodeCountUbuntu:
-    type: number
-    default: 1
-  ComputeNodeCountCentos7:
-    type: number
-    default: 1
-- 
GitLab