ipmi: Fix log output, set IMPI port on profile and settings for console
- Fix the logs to reference the correct IPMI setting that is being set. - Add setting the IPMI port at a profile level. - Apply all IPMI settings when preparing to us the console. Closes #225
This commit is contained in:
@@ -96,12 +96,17 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
if SetIpmiNetmask != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI username to: %s\n", p.Id.Get(), SetIpmiNetmask)
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI netmask to: %s\n", p.Id.Get(), SetIpmiNetmask)
|
||||
p.IpmiNetmask.Set(SetIpmiNetmask)
|
||||
}
|
||||
|
||||
if SetIpmiPort != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI port to: %s\n", p.Id.Get(), SetIpmiPort)
|
||||
p.IpmiPort.Set(SetIpmiPort)
|
||||
}
|
||||
|
||||
if SetIpmiGateway != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI username to: %s\n", p.Id.Get(), SetIpmiGateway)
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI gateway to: %s\n", p.Id.Get(), SetIpmiGateway)
|
||||
p.IpmiGateway.Set(SetIpmiGateway)
|
||||
}
|
||||
|
||||
@@ -111,12 +116,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
if SetIpmiPassword != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI username to: %s\n", p.Id.Get(), SetIpmiPassword)
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI password to: %s\n", p.Id.Get(), SetIpmiPassword)
|
||||
p.IpmiPassword.Set(SetIpmiPassword)
|
||||
}
|
||||
|
||||
if SetIpmiInterface != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI username to: %s\n", p.Id.Get(), SetIpmiInterface)
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting IPMI interface to: %s\n", p.Id.Get(), SetIpmiInterface)
|
||||
p.IpmiInterface.Set(SetIpmiInterface)
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ var (
|
||||
SetRuntimeOverlay string
|
||||
SetSystemOverlay string
|
||||
SetIpmiNetmask string
|
||||
SetIpmiPort string
|
||||
SetIpmiGateway string
|
||||
SetIpmiUsername string
|
||||
SetIpmiPassword string
|
||||
@@ -103,10 +104,11 @@ func init() {
|
||||
log.Println(err)
|
||||
}
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiNetmask, "ipminetmask", "", "Set the node's IPMI netmask")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiPort, "ipmiport", "", "Set the node's IPMI port")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiGateway, "ipmigateway", "", "Set the node's IPMI gateway")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiUsername, "ipmiuser", "", "Set the node's IPMI username")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiPassword, "ipmipass", "", "Set the node's IPMI password")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiInterface, "ipmiinterface", "", "Set the node's IPMI interface (defaults to 'lan' if empty)")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiInterface, "ipmiinterface", "", "Set the node's IPMI interface (defaults to 'lan')")
|
||||
|
||||
baseCmd.PersistentFlags().StringVarP(&SetNetDev, "netdev", "N", "", "Define the network device to configure")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetIpaddr, "ipaddr", "I", "", "Set the node's network device IP address")
|
||||
|
||||
Reference in New Issue
Block a user