diff options
Diffstat (limited to 'deploy/template/power')
-rw-r--r-- | deploy/template/power/ipmitool.tmpl | 25 | ||||
-rw-r--r-- | deploy/template/power/smmset.tmpl | 22 |
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 |