A webhook to amt proxy for MAAS power drivers.
This is a very crude, quick and dirty script -- do not use for prodution
This proxy does not need authentication, but the user and password provided will be passed on to the amt endpoints so they are needed.
Run this anywhere that is reachable from both MAAS and the AMT nodes.
MAAS sends POST instead of get (but with empty body) for start/stop but sends a GET for getting state.
On the python code, there is no configuration, just run it (and leave it running).
On MAAS:
Power type = webhook
URI to power on the node = http://<IP-OF-PROXY>:8880/amtproxy?cmd=start&host=<IP-OF-AMT>&port=16993
URI to power off the node = http://<IP-OF-PROXY>:8880/amtproxy?cmd=stop&host=<IP-OF-AMT>&port=16993
URI to query the nodes power status = http://<IP-OF-PROXY>:8880/amtproxy?cmd=state&host=<IP-OF-AMT>&port=16993
Regex to confirm the node is on = "Power State: On"
Regex to confirm the node is off = "Power State: Off"
Power user = 'admin'
Power password = 'password-of-AMT'
Power token, will be used in place of power_user and power_pass = leave empty
Verify SSL connections with system CA certificates = No