From 3e45effa785daede9e07545cb94639a438606540 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Mon, 6 Oct 2014 23:40:47 +0100 Subject: [PATCH] updated template, this now actually works now we need to add proper data i.e. add slurm, and add quick job Signed-off-by: Arif Ali --- heat_templates/compute_node.yaml | 39 ++++++++++++++------------------ heat_templates/hpc.yaml | 31 +++++++++++-------------- 2 files changed, 30 insertions(+), 40 deletions(-) diff --git a/heat_templates/compute_node.yaml b/heat_templates/compute_node.yaml index 5141176..42642f1 100644 --- a/heat_templates/compute_node.yaml +++ b/heat_templates/compute_node.yaml @@ -28,9 +28,9 @@ parameters: master_node_ip: type: string description: IP address of the Master node. - #index_name: - # type: string - # description: IP address of the Master node. + index_name: + type: string + description: IP address of the Master node. resources: @@ -57,7 +57,7 @@ resources: compute_node: type: OS::Nova::Server properties: - name: compute + name: {"Fn::Join" : ["",["compute", { get_param: index_name }]]} image: { get_param: image } flavor: { get_param: flavor } key_name: { get_param: key_name } @@ -69,31 +69,26 @@ resources: template: | #!/bin/sh - cat > /etc/yum.repos.d/epel-7.repo << EOF - [epel-7] - name=epel-7 - baseurl=http://192.168.33.200/install/post/otherpkgs/el7/epel - enabled=1 - gpgcheck=0 - EOF - - cat > /etc/yum.repos.d/rdo-openstack.repo << EOF - [rdo-openstack] - name=rdo-openstack - baseurl=http://192.168.33.200/install/post/otherpkgs/el7/rdo-openstack - enabled=1 - gpgcheck=0 - EOF + set -ax yum -y remove NetworkManager chkconfig network on - yum -y install heat-cfntools - myip=$(ip addr show eth0 | awk '$1 == "inet" {print $2}' | cut -f1 -d/) myip_last_octet=${myip##*.} - cfn-signal -e0 --data 'OK' -r 'Setup complete' '$WAIT_HANDLE' + cat > /tmp/wait-data << EOF + { + "Status" : "SUCCESS", + "Reason" : "Setup Complete", + "UniqueId" : "None", + "Data" : "OK" + } + EOF + curl -T /tmp/wait-data '$WAIT_HANDLE' + + echo $MASTER_NODE_IP + params: "$MASTER_NODE_IP": get_param: master_node_ip diff --git a/heat_templates/hpc.yaml b/heat_templates/hpc.yaml index dd1e50c..d0ecaaf 100644 --- a/heat_templates/hpc.yaml +++ b/heat_templates/hpc.yaml @@ -144,29 +144,24 @@ resources: template: | #!/bin/sh + set -ax + yum -y upgrade - cat > /etc/yum.repos.d/epel-7.repo << EOF - [epel-7] - name=epel-7 - baseurl=http://192.168.33.200/install/post/otherpkgs/el7/epel - enabled=1 - gpgcheck=0 + cat > /tmp/wait-data << EOF + { + "Status" : "SUCCESS", + "Reason" : "Setup Complete", + "UniqueId" : "None", + "Data" : "OK" + } EOF + curl -T /tmp/wait-data '$WAIT_HANDLE' - cat > /etc/yum.repos.d/rdo-openstack.repo << EOF - [rdo-openstack] - name=rdo-openstack - baseurl=http://192.168.33.200/install/post/otherpkgs/el7/rdo-openstack - enabled=1 - gpgcheck=0 - EOF + echo $COMP_NODE_ADDRESSES - yum -y install heat-cfntools - - cfn-signal -e0 --data 'OK' -r 'Setup complete' '$WAIT_HANDLE' params: - #"$COMP_NODE_ADDRESSES": {"Fn::Join": [",", {get_attr: [compute_nodes, compute_node_ip]}]} + "$COMP_NODE_ADDRESSES": {"Fn::Join": [",", {get_attr: [compute_nodes, compute_node_ip]}]} "$WAIT_HANDLE": get_resource: master_wait_handle networks: @@ -204,7 +199,7 @@ resources: resource_def: type: compute_node.yaml properties: - #index_name: %index% + index_name: "%index%" key_name: {get_param: key_name} image: {get_param: image} flavor: {get_param: flavor}