summaryrefslogtreecommitdiffstats
path: root/deploy/template
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-09-08 07:47:19 -0400
committerbaigk <baiguoku@huawei.com>2015-09-08 08:24:09 -0400
commitcf87d3067a63cb8be315a3addfd9c27d86be3b5a (patch)
tree861d46aebc75c73cc13a19fecfb5c48aa88a56a1 /deploy/template
parent633175ed2c5d0ab339027ba0a542bcdd4d3769c0 (diff)
Build improvement for speedup and using public repo
JIRA: COMPASS-19 Change-Id: Iba101807e1bd2f843f1253791b7e87e1acb7934b Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/template')
-rw-r--r--deploy/template/power/ipmitool.tmpl25
-rw-r--r--deploy/template/power/smmset.tmpl22
2 files changed, 47 insertions, 0 deletions
diff --git a/deploy/template/power/ipmitool.tmpl b/deploy/template/power/ipmitool.tmpl
new file mode 100644
index 00000000..a3157132
--- /dev/null
+++ b/deploy/template/power/ipmitool.tmpl
@@ -0,0 +1,25 @@
+#set default_ipmiUser=$getVar('ipmiUser', '')
+#set default_ipmiPass=$getVar('ipmiPass', '')
+#set hosts=$getVar('hosts', [])
+#set fail_list=""
+#for host in $hosts
+#set host_name=$host.get('name', '')
+#set ipmiIp=$host.get('ipmiIp', '')
+#set ipmiUser=$host.get('ipmiUser', $default_ipmiUser)
+#set ipmiPass=$host.get('ipmiPass', $default_ipmiPass)
+#if not ($ipmiIp and $ipmiUser and $ipmiPass)
+#set fail_list=$fail_list + $host_name + " "
+#end if
+#end for
+#if fail_list
+echo $fail_list.strip() ipmi config is not right
+exit 1
+#else
+#for host in $hosts
+#set ipmiIp=$host.get('ipmiIp', '')
+#set ipmiUser=$host.get('ipmiUser', $default_ipmiUser)
+#set ipmiPass=$host.get('ipmiPass', $default_ipmiPass)
+ipmitool -I lan -H $ipmiIp -U $ipmiUser -P $ipmiPass chassis bootdev pxe
+ipmitool -I lan -H $ipmiIp -U $ipmiUser -P $ipmiPass chassis power reset
+#end for
+#end if
diff --git a/deploy/template/power/smmset.tmpl b/deploy/template/power/smmset.tmpl
new file mode 100644
index 00000000..e673a682
--- /dev/null
+++ b/deploy/template/power/smmset.tmpl
@@ -0,0 +1,22 @@
+#set hosts=$getVar('hosts', [])
+#set fail_list=""
+#set location_list=""
+#for host in $hosts
+#set host_name=$host.get('name', '')
+#set location=$host.get('location', '')
+#if not $location
+#set fail_list=$fail_list + $host_name + " "
+#else
+#set location_list=$location_list + str($location)+ " "
+#end if
+#end for
+#if fail_list
+echo $fail_list.strip() config is wrong
+exit 1
+#else
+cmd='for i in $location_list.strip(); do \
+ /dev/shm/smm/usr/bin/smmset -l blade\$i -d bootoption -v 1 0; \
+ echo Y | /dev/shm/smm/usr/bin/smmset -l blade\$i -d frucontrol -v 0; done'
+
+/usr/bin/expect \${COMPASS_DIR}/deploy/remote_excute.exp \${SWITCH_IPS} 'root' 'Admin@7*24' "\$cmd"
+#end if