Skip to content

Commit

Permalink
added template for nodes without bmc
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Goll <cgoll@suse.com>
  • Loading branch information
mslacken committed Dec 6, 2023
1 parent da64921 commit 6ddc3dc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/warewulf/bmc/nobmc.tmpl
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 6ddc3dc

Please sign in to comment.