added template for nodes without bmc

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-12-06 12:12:15 +01:00
committed by Jonathon Anderson
parent f53ae48ae6
commit b422fd8de2
2 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
{{/* used command to access nodes without bmc*/}}
{{- $cmd := "echo command not found" }}
{{- if eq .Cmd "PowerOn" }} {{ $cmd = printf "wol %s" .Interface }} {{ end }}
{{- if eq .Cmd "PowerOff" }} {{ $cmd = printf "ssh %s echo o > /proc/sysrq-trigger" .Ipaddr }} {{ end }}
{{- if eq .Cmd "PowerCycle" }} {{ $cmd = printf "ssh %s echo r > /proc/sysrq-trigger" .Ipaddr }} {{ end }}
{{- if eq .Cmd "PowerRest" }} {{ $cmd = printf "ssh %s echo r > /proc/sysrq-trigger" .Ipaddr }} {{ end }}
{{- if eq .Cmd "PowerSoft" }} {{ $cmd = print "ssh %s reboot" .Ipaddr }} {{ end }}
{{- if eq .Cmd "PowerStatus" }} {{ $args = "ping -c 1 %s &> /dev/null %s && echo ON || echo OFF" .Ipaddr }} {{ end }}
{{- if eq .Cmd "SDRList" }} {{ $cmd = print "ssh %s sensors" .Ipaddr }} {{ end }}
{{- if eq .Cmd "SensorList" }} {{ $cmd = print "ssh %s sensors" .Ipaddr }} {{ end }}
{{- if eq .Cmd "Console" }} {{ $args = "echo node sol" }} {{ end }}
{{ $cmd }}