Compare commits
2 Commits
b0fb48925f
...
c86a14477c
Author | SHA1 | Date | |
---|---|---|---|
c86a14477c | |||
61f7f33c92 |
@ -274,7 +274,7 @@ def entrypoint():
|
|||||||
|
|
||||||
def term(signum="", frame=""):
|
def term(signum="", frame=""):
|
||||||
print("Received TERM, exiting.")
|
print("Received TERM, exiting.")
|
||||||
notifications.send_webhook(config, "begin", "Received TERM, exiting pvcbootstrapd")
|
notifications.send_webhook(config, "completed", "Received TERM, exiting pvcbootstrapd")
|
||||||
cleanup(0)
|
cleanup(0)
|
||||||
|
|
||||||
signal.signal(signal.SIGTERM, term)
|
signal.signal(signal.SIGTERM, term)
|
||||||
|
@ -227,6 +227,7 @@ def run_hook_script(config, targets, args):
|
|||||||
source = args.get("source", None)
|
source = args.get("source", None)
|
||||||
path = args.get("path", None)
|
path = args.get("path", None)
|
||||||
arguments = args.get("arguments", [])
|
arguments = args.get("arguments", [])
|
||||||
|
use_sudo = args.get("use_sudo", False)
|
||||||
|
|
||||||
logger.info(f"Running script on node {node_name}")
|
logger.info(f"Running script on node {node_name}")
|
||||||
|
|
||||||
@ -262,6 +263,9 @@ def run_hook_script(config, targets, args):
|
|||||||
else:
|
else:
|
||||||
remote_command = remote_path
|
remote_command = remote_path
|
||||||
|
|
||||||
|
if use_sudo:
|
||||||
|
remote_command = f"sudo {remote_command}"
|
||||||
|
|
||||||
stdin, stdout, stderr = c.exec_command(remote_command)
|
stdin, stdout, stderr = c.exec_command(remote_command)
|
||||||
logger.debug(stdout.readlines())
|
logger.debug(stdout.readlines())
|
||||||
logger.debug(stderr.readlines())
|
logger.debug(stderr.readlines())
|
||||||
|
@ -98,7 +98,7 @@ def host_checkin(config, data):
|
|||||||
elif data["action"] in ["install-complete"]:
|
elif data["action"] in ["install-complete"]:
|
||||||
# Node install has finished
|
# Node install has finished
|
||||||
logger.info(f"Registering install complete for host {data['hostname']}")
|
logger.info(f"Registering install complete for host {data['hostname']}")
|
||||||
notifications.send_webhook(config, "begin", f"Cluster {cspec_cluster}: Registering install complete for host {data['hostname']}")
|
notifications.send_webhook(config, "success", f"Cluster {cspec_cluster}: Registering install complete for host {data['hostname']}")
|
||||||
host.installer_complete(config, cspec, data)
|
host.installer_complete(config, cspec, data)
|
||||||
|
|
||||||
elif data["action"] in ["system-boot_initial"]:
|
elif data["action"] in ["system-boot_initial"]:
|
||||||
|
@ -849,13 +849,15 @@ def redfish_init(config, cspec, data):
|
|||||||
logger.info("Setting temporary PXE boot...")
|
logger.info("Setting temporary PXE boot...")
|
||||||
set_boot_override(session, system_root, redfish_vendor, "Pxe")
|
set_boot_override(session, system_root, redfish_vendor, "Pxe")
|
||||||
|
|
||||||
|
notifications.send_webhook(config, "success", f"Cluster {cspec_cluster}: Completed Redfish initialization of host {cspec_hostname}")
|
||||||
|
|
||||||
# Turn on the system
|
# Turn on the system
|
||||||
logger.info("Powering on node...")
|
logger.info("Powering on node...")
|
||||||
set_power_state(session, system_root, redfish_vendor, "on")
|
set_power_state(session, system_root, redfish_vendor, "on")
|
||||||
|
notifications.send_webhook(config, "begin", f"Cluster {cspec_cluster}: Powering on host {cspec_hostname}")
|
||||||
|
|
||||||
node = db.update_node_state(config, cspec_cluster, cspec_hostname, "pxe-booting")
|
node = db.update_node_state(config, cspec_cluster, cspec_hostname, "pxe-booting")
|
||||||
|
|
||||||
notifications.send_webhook(config, "success", f"Cluster {cspec_cluster}: Completed Redfish initialization of host {cspec_hostname}")
|
|
||||||
logger.info("Waiting for completion of node and cluster installation...")
|
logger.info("Waiting for completion of node and cluster installation...")
|
||||||
# Wait for the system to install and be configured
|
# Wait for the system to install and be configured
|
||||||
while node.state != "booted-completed":
|
while node.state != "booted-completed":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user