Move default ipmi template to default profile
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -26,4 +26,6 @@ nodeprofiles:
|
||||
init: /sbin/init
|
||||
root: initramfs
|
||||
ipxe template: default
|
||||
ipmi:
|
||||
template: ipmitool.tmpl
|
||||
nodes: {}
|
||||
|
||||
@@ -19,6 +19,7 @@ func Test_Sensors(t *testing.T) {
|
||||
nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
template: ipmitool.tmpl
|
||||
username: admin
|
||||
password: admin
|
||||
nodes:
|
||||
|
||||
@@ -19,6 +19,7 @@ func Test_PowerCycle(t *testing.T) {
|
||||
nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
template: ipmitool.tmpl
|
||||
username: admin
|
||||
password: admin
|
||||
nodes:
|
||||
|
||||
@@ -19,6 +19,7 @@ func Test_Power_Status(t *testing.T) {
|
||||
nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
template: ipmitool.tmpl
|
||||
username: admin
|
||||
password: admin
|
||||
nodes:
|
||||
|
||||
@@ -19,6 +19,7 @@ func Test_Power_Status(t *testing.T) {
|
||||
nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
template: ipmitool.tmpl
|
||||
username: admin
|
||||
password: admin
|
||||
nodes:
|
||||
|
||||
@@ -19,6 +19,7 @@ func Test_Power_Status(t *testing.T) {
|
||||
nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
template: ipmitool.tmpl
|
||||
username: admin
|
||||
password: admin
|
||||
nodes:
|
||||
|
||||
@@ -19,6 +19,7 @@ func Test_Power_Status(t *testing.T) {
|
||||
nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
template: ipmitool.tmpl
|
||||
username: admin
|
||||
password: admin
|
||||
nodes:
|
||||
|
||||
@@ -19,6 +19,7 @@ func Test_Power_Status(t *testing.T) {
|
||||
nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
template: ipmitool.tmpl
|
||||
username: admin
|
||||
password: admin
|
||||
nodes:
|
||||
|
||||
@@ -32,15 +32,16 @@ func (ipmi *IPMI) Result() (string, error) {
|
||||
}
|
||||
|
||||
func (ipmi *IPMI) getStr() (cmdStr string, err error) {
|
||||
conf := warewulfconf.Get()
|
||||
if ipmi.Template == "" {
|
||||
ipmi.Template = path.Join(conf.Warewulf.DataStore, "warewulf/bmc/ipmitool.tmpl")
|
||||
} else if !strings.HasPrefix(ipmi.Template, "/") {
|
||||
return "", fmt.Errorf("no ipmi/bmc template specified")
|
||||
}
|
||||
if !strings.HasPrefix(ipmi.Template, "/") {
|
||||
conf := warewulfconf.Get()
|
||||
ipmi.Template = path.Join(conf.Warewulf.DataStore, "warewulf/bmc", ipmi.Template)
|
||||
}
|
||||
fbuf, err := os.ReadFile(ipmi.Template)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("couldn't find the template which defines the ipmi/redfish command: %s", err)
|
||||
return "", fmt.Errorf("couldn't find the template which defines the ipmi/bmc command: %s", err)
|
||||
}
|
||||
cmdTmpl, err := template.New("bmc command").Parse(string(fbuf))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user