Skip to content
Snippets Groups Projects
Commit 7f85baf1 authored by Andreas Hamacher's avatar Andreas Hamacher
Browse files

some refactoring in the heat templates to allow more diverse stacks

parent 3be57110
No related branches found
No related tags found
1 merge request!293Ubuntu
...@@ -117,7 +117,7 @@ resources: ...@@ -117,7 +117,7 @@ resources:
MgmtNodesC: MgmtNodesC:
type: "OS::Heat::ResourceGroup" type: "OS::Heat::ResourceGroup"
properties: properties:
count: 1 count: My::Server::MgmtNodeCountCentos7
resource_def: resource_def:
type: My::Server::MgmtNode type: My::Server::MgmtNode
properties: properties:
...@@ -133,7 +133,7 @@ resources: ...@@ -133,7 +133,7 @@ resources:
MgmtNodesU: MgmtNodesU:
type: "OS::Heat::ResourceGroup" type: "OS::Heat::ResourceGroup"
properties: properties:
count: 1 count: My::Server::MgmtNodeCountUbuntu
resource_def: resource_def:
type: My::Server::MgmtNode type: My::Server::MgmtNode
properties: properties:
...@@ -149,7 +149,7 @@ resources: ...@@ -149,7 +149,7 @@ resources:
LoginNodesC: LoginNodesC:
type: "OS::Heat::ResourceGroup" type: "OS::Heat::ResourceGroup"
properties: properties:
count: 0 count: My::Server::LoginNodeCountCentos
resource_def: resource_def:
type: "OS::Nova::Server" type: "OS::Nova::Server"
properties: properties:
...@@ -170,7 +170,7 @@ resources: ...@@ -170,7 +170,7 @@ resources:
LoginNodesU: LoginNodesU:
type: "OS::Heat::ResourceGroup" type: "OS::Heat::ResourceGroup"
properties: properties:
count: 1 count: My::Server::LoginNodeCountUbuntu
resource_def: resource_def:
type: "OS::Nova::Server" type: "OS::Nova::Server"
properties: properties:
...@@ -212,7 +212,7 @@ resources: ...@@ -212,7 +212,7 @@ resources:
ComputeNodesU: ComputeNodesU:
type: "OS::Heat::ResourceGroup" type: "OS::Heat::ResourceGroup"
properties: properties:
count: 1 count: My::Server::ComputeNodeCountUbuntu
resource_def: resource_def:
type: "OS::Nova::Server" type: "OS::Nova::Server"
properties: properties:
...@@ -233,7 +233,7 @@ resources: ...@@ -233,7 +233,7 @@ resources:
ComputeNodesC: ComputeNodesC:
type: "OS::Heat::ResourceGroup" type: "OS::Heat::ResourceGroup"
properties: properties:
count: 1 count: My::Server::ComputeNodeCountCentos
resource_def: resource_def:
type: "OS::Nova::Server" type: "OS::Nova::Server"
properties: properties:
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
function usage { function usage {
echo $"Usage: $0 {create|update|show|create_or_update,delete_if_exists} STACKNAME" echo $"Usage: $0 {create|update|show|create_or_update,delete_if_exists} STACKNAME CI_PROJECT_NAME"
exit 1 exit 1
} }
if [ "$#" -ne 2 ]; then if [ "$#" -ne 3 ]; then
echo "Illegal number of parameters expecting 2" echo "Illegal number of parameters expecting 3"
usage usage
fi fi
STACKNAME=$2 STACKNAME=$2
CI_PROJECT_NAME=$3
if [[ "$STACKNAME" == "CICD"* ]]; then if [[ "$STACKNAME" == "CICD"* ]]; then
echo "CICD found in stackname. doing nothing" echo "CICD found in stackname. doing nothing"
...@@ -60,7 +60,7 @@ function create_stack { ...@@ -60,7 +60,7 @@ function create_stack {
echo "I will NOT create existing stack maybe use update" echo "I will NOT create existing stack maybe use update"
exit -44 exit -44
fi fi
openstack stack create --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml $STACKNAME openstack stack create --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./resource_registry.${CI_PROJECT_NAME}.yaml $STACKNAME
createreturn=$? createreturn=$?
if [ $createreturn -ne "0" ] if [ $createreturn -ne "0" ]
then then
...@@ -83,14 +83,14 @@ case "$1" in ...@@ -83,14 +83,14 @@ case "$1" in
echo "I cannot update a stack which does not exist" echo "I cannot update a stack which does not exist"
exit -45 exit -45
fi fi
openstack stack update --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml $STACKNAME openstack stack update --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./resource_registry.${CI_PROJECT_NAME}.yaml $STACKNAME
ret=$? ret=$?
exit $ret exit $ret
;; ;;
create_or_update) create_or_update)
if check_stack_exists if check_stack_exists
then then
openstack stack update --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./heat/resource_registry.yaml $STACKNAME openstack stack update --wait --template ./heat/gc_HOT.yaml --parameter "project_name=$STACKNAME" -e ./resource_registry.${CI_PROJECT_NAME}.yaml $STACKNAME
ret=$? ret=$?
exit $ret exit $ret
fi fi
......
resource_registry:
My::Server::MgmtNode: mgmtnode_HOT.yaml
resource_registry:
My::Server::MgmtNode: mgmtnode_HOT.yaml
My::Server::MgmtNodeCountUbuntu: 1
My::Server::MgmtNodeCountCentos7: 1
My::Server::LoginNodeCountCentos: 0
My::Server::LoginNodeCountUbuntu: 1
My::Server::ComputeNodeCountUbuntu: 1
My::Server::ComputeNodeCountCentos: 1
...@@ -3,7 +3,7 @@ desktopNodeList: ...@@ -3,7 +3,7 @@ desktopNodeList:
- { name : 'DesktopNodes', interface : 'eth0' } - { name : 'DesktopNodes', interface : 'eth0' }
clustername: "m3" clustername: "m3"
projectname: "m3" projectname: "m3"
slurm_version: 19.05.3-2 slurm_version: 19.05.4
munge_version: 0.5.13 munge_version: 0.5.13
nhc_version: 1.4.2 nhc_version: 1.4.2
munge_dir: /opt/munge-{{ munge_version }} munge_dir: /opt/munge-{{ munge_version }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment