Disable unsafe lab scheduler and fix OCI state status
This commit is contained in:
parent
662b94aead
commit
b3e0d6e01f
|
|
@ -429,7 +429,7 @@ EOF
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
. /etc/homelab-lab-window.env
|
||||
action="${1:?start or stop is required}"
|
||||
action="$${1:?start or stop is required}"
|
||||
case "$action" in start|stop) ;; *) exit 2 ;; esac
|
||||
payload="$(printf '{"command":"lab-window","args":["%s"]}' "$action")"
|
||||
response="$(curl --noproxy '*' -fsS --connect-timeout 10 --max-time 30 \
|
||||
|
|
@ -469,7 +469,7 @@ SERVICE_EOT
|
|||
[Unit]
|
||||
Description=Start Jeannie lab at 08:00 local time
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 08:00:00 ${lab_schedule_timezone}
|
||||
OnCalendar=*-*-* 08:00:00 $lab_schedule_timezone
|
||||
Unit=homelab-lab-window-start.service
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
|
@ -478,7 +478,7 @@ SERVICE_EOT
|
|||
[Unit]
|
||||
Description=Stop Jeannie lab at 17:00 local time
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 17:00:00 ${lab_schedule_timezone}
|
||||
OnCalendar=*-*-* 17:00:00 $lab_schedule_timezone
|
||||
Unit=homelab-lab-window-stop.service
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
|
|
|||
|
|
@ -85,7 +85,12 @@ variable "edge_install_docker" {
|
|||
|
||||
variable "lab_schedule_enabled" {
|
||||
type = bool
|
||||
default = true
|
||||
default = false
|
||||
|
||||
validation {
|
||||
condition = !var.lab_schedule_enabled
|
||||
error_message = "The legacy SSH-based lab scheduler is disabled until OCI agent installation and lifecycle recovery are implemented."
|
||||
}
|
||||
}
|
||||
|
||||
variable "lab_schedule_api_url" {
|
||||
|
|
|
|||
|
|
@ -216,6 +216,10 @@ when Pimox workers or cluster networking are the thing being investigated.
|
|||
|
||||
## Scheduled lab power window
|
||||
|
||||
**Not available yet.** The original SSH-based scheduler is disabled while its
|
||||
OCI agent installation, credential handling, and shutdown recovery are being
|
||||
reworked. Do not apply or enable the timers described below.
|
||||
|
||||
The OCI edge can keep the management plane available while starting the
|
||||
selected cluster and host services at 08:00 and stopping the data plane at
|
||||
17:00 in `America/Mexico_City`. The edge timer calls the authenticated Jeannie
|
||||
|
|
|
|||
|
|
@ -216,6 +216,10 @@ when Pimox workers or cluster networking are the thing being investigated.
|
|||
|
||||
## Scheduled lab power window
|
||||
|
||||
**Not available yet.** The original SSH-based scheduler is disabled while its
|
||||
OCI agent installation, credential handling, and shutdown recovery are being
|
||||
reworked. Do not apply or enable the timers described below.
|
||||
|
||||
The OCI edge can keep the management plane available while starting the
|
||||
selected cluster and host services at 08:00 and stopping the data plane at
|
||||
17:00 in `America/Mexico_City`. The edge timer calls the authenticated Jeannie
|
||||
|
|
|
|||
|
|
@ -775,12 +775,8 @@ lab_window() {
|
|||
start_cluster || return 1
|
||||
;;
|
||||
stop)
|
||||
require_debian_server "lab-window stop"
|
||||
echo "Stopping the scheduled lab window; keeping jeannie-server and the OCI edge available."
|
||||
shutdown_rpi_services || return 1
|
||||
stop_cluster || return 1
|
||||
shutdown_oci_email_services || return 1
|
||||
shutdown_debian_services
|
||||
echo "Scheduled shutdown is disabled: the API execution worker must remain available for the next startup." >&2
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ./jeannie lab-window {start|stop|status}" >&2
|
||||
|
|
@ -4110,7 +4106,15 @@ oci_foundation_manage() {
|
|||
python3 "${REPO_ROOT}/tests/jeannie/test_oci_foundation_resolve.py"
|
||||
;;
|
||||
status)
|
||||
tofu -chdir="${stack}" show "${tofu_state_args[@]}" -no-color 2>/dev/null || echo "OCI foundation has no state yet."
|
||||
if [[ -n "${state_file}" ]]; then
|
||||
if [[ ! -f "${state_file}" ]]; then
|
||||
echo "OCI foundation state file not found: ${state_file}" >&2
|
||||
return 1
|
||||
fi
|
||||
tofu -chdir="${stack}" show -no-color "${state_file}" || return 1
|
||||
else
|
||||
tofu -chdir="${stack}" show -no-color || return 1
|
||||
fi
|
||||
;;
|
||||
plan|apply)
|
||||
# Serialize generated import declarations as well as state access.
|
||||
|
|
|
|||
Loading…
Reference in New Issue