add a reset-bmc command
Add a reset-bmc command with the same arguments as the inspect-bmh commands, with an additional --shutdown flag to shutdown the server beforehand.
Example output:
./sylvactl reset-bmc --insecure --shutdown secrets.yaml values.yaml
===============================
connecting to sylvabmh@le-sr250v3-167 (https://172.20.8.167) (insecure=true)
Resetting BMC for le-sr250v3-167
System 1 is already shut down
Resetting manager 1...
Resetting manager 1 with GracefulRestart...
Manager 1 reset command successful with GracefulRestart
===============================
connecting to sylvabmh@dell-r360-165 (https://172.20.8.165) (insecure=true)
Resetting BMC for dell-r360-165
System System.Embedded.1 is already shut down
Resetting manager iDRAC.Embedded.1...
Resetting manager iDRAC.Embedded.1 with GracefulRestart...
Manager iDRAC.Embedded.1 reset command successful with GracefulRestart
===============================
connecting to Administrator@hp-dl20g11-166 (https://172.20.8.166) (insecure=true)
Resetting BMC for hp-dl20g11-166
System 1 is already shut down
Resetting manager 1...
Resetting manager 1 with GracefulRestart...
Manager 1 reset command successful with GracefulRestartTo avoid code duplication between the two commands, I moved most of the common logic into functions in the new bmh-utils.go file.
When managing multiple hosts, the commands will no longer fail on the first error.
Edited by Jonathan GAYVALLET