Files
warewulf/lib/warewulf/bmc/ipmitool.tmpl
Jonathon Anderson d1697ef83d Simplify bmc templates
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-07 23:01:32 -07:00

16 lines
1.0 KiB
Cheetah

{{/* used command to access the ipmi interface of the nodes */}}
{{- $escapechar := "~" }}{{ if .EscapeChar }}{{ $escapechar = .EscapeChar }}{{ end }}
{{- $port := "623" }}{{ if .Port }}{{ $port = .Port }}{{ end }}
{{- $interface := "lan" }}{{- if .Interface }}{{ $interface = .Interface }}{{ end }}
{{- $args := "" }}
{{- if eq .Cmd "PowerOn" }}{{ $args = "chassis power on" }}
{{- else if eq .Cmd "PowerOff" }}{{ $args = "chassis power off" }}
{{- else if eq .Cmd "PowerCycle" }}{{ $args = "chassis power cycle" }}
{{- else if eq .Cmd "PowerReset" }}{{ $args = "chassis power reset" }}
{{- else if eq .Cmd "PowerSoft" }}{{ $args = "chassis power soft" }}
{{- else if eq .Cmd "PowerStatus" }}{{ $args = "chassis power status" }}
{{- else if eq .Cmd "SDRList" }}{{ $args = "sdr list" }}
{{- else if eq .Cmd "SensorList" }}{{ $args = "sensor list" }}
{{- else if eq .Cmd "Console" }}{{ $args = "sol activate" }}{{ end }}
ipmitool -I {{ $interface }} -H {{ .Ipaddr }} -p {{ $port }} -U {{ .UserName }} -P {{ .Password }} -e {{ $escapechar }} {{ $args }}