30_runtime_blueprint.sh calls POST /templates/{id}/resolve with the
device_id from the server handshake and the template_id from the
Bereitstellungsvorlage selection, storing the resulting Runtime
Blueprint under /run/tuxflotte/runtime/.
40_backend.sh dispatches to backends/${backend_id}/backend.sh based on
the resolved backend_id and drives the backend_init/validate/
generate_config/launch/postinstall lifecycle from 06-backend-api.md.
backends/fedora/backend.sh implements that lifecycle for Fedora:
backend_generate_config() renders kickstart.tpl via envsubst using the
Runtime Blueprint's installation_directives and the device hostname,
embedding the resolved Merkmal blueprints as JSON for the (not yet
implemented) Provisioning Agent to apply later. Replaces the old
git-clone-based %post bootstrap. backend_launch()/backend_postinstall()
are Phase 1 stubs pending the live-ISO boot integration (see
platform-docs ADR-0003).
85 lines
2.5 KiB
Bash
Executable File
85 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
INSTALLER_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
source "$SCRIPT_DIR/lib/logging.sh"
|
|
source "$SCRIPT_DIR/lib/errors.sh"
|
|
source "$SCRIPT_DIR/lib/utils.sh"
|
|
source "$SCRIPT_DIR/lib/checks.sh"
|
|
|
|
DRY_RUN=false
|
|
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--dry-run) DRY_RUN=true ;;
|
|
*) error_exit "Unbekannter Parameter: $arg" ;;
|
|
esac
|
|
done
|
|
|
|
load_config "$INSTALLER_ROOT/config/installer.conf"
|
|
|
|
log_info "Tuxflotte Installer gestartet"
|
|
log_info "Installer Root: $INSTALLER_ROOT"
|
|
|
|
[[ "$DRY_RUN" == true ]] && log_warn "Dry-Run aktiv"
|
|
|
|
run_module "$SCRIPT_DIR/modules/00_preflight.sh" "always"
|
|
run_module "$SCRIPT_DIR/modules/05_network.sh" "always"
|
|
run_module "$SCRIPT_DIR/modules/10_hardware.sh" "always"
|
|
run_module "$SCRIPT_DIR/modules/12_enrollment_auth.sh" "always"
|
|
run_module "$SCRIPT_DIR/modules/15_server_handshake.sh" "always"
|
|
run_module "$SCRIPT_DIR/modules/17_device_status.sh" "always"
|
|
PROVISIONING_STATE_FILE="/run/tuxflotte/provisioning/state.env"
|
|
|
|
[[ -r "$PROVISIONING_STATE_FILE" ]] ||
|
|
error_exit "Provisionierungszustand fehlt: $PROVISIONING_STATE_FILE"
|
|
|
|
# shellcheck disable=SC1090
|
|
source "$PROVISIONING_STATE_FILE"
|
|
|
|
case "${TUXFLOTTE_PROVISIONING_CONTINUE:-}" in
|
|
true)
|
|
log_info "Provisionierung wird fortgesetzt."
|
|
;;
|
|
false)
|
|
log_info "Provisionierung wurde durch den Benutzer kontrolliert beendet."
|
|
exit 0
|
|
;;
|
|
*)
|
|
error_exit "Ungültiger Provisionierungszustand."
|
|
;;
|
|
esac
|
|
run_module "$SCRIPT_DIR/modules/20_profile_selection.sh" "always"
|
|
run_module "$SCRIPT_DIR/modules/25_installation_confirm.sh" "always"
|
|
|
|
INSTALLATION_STATE_FILE="/run/tuxflotte/installation/state.env"
|
|
|
|
[[ -r "$INSTALLATION_STATE_FILE" ]] ||
|
|
error_exit "Installationsbestätigung fehlt: $INSTALLATION_STATE_FILE"
|
|
|
|
# shellcheck disable=SC1090
|
|
source "$INSTALLATION_STATE_FILE"
|
|
|
|
case "${TUXFLOTTE_INSTALLATION_CONFIRMED:-}" in
|
|
true)
|
|
log_info "Commit Point bestätigt. Installationsphase wird fortgesetzt."
|
|
;;
|
|
false)
|
|
log_info "Provisionierung wurde durch den Benutzer kontrolliert beendet."
|
|
log_info "Es wurden keine destruktiven Installationsaktionen gestartet."
|
|
exit 0
|
|
;;
|
|
*)
|
|
error_exit "Ungültiger Installationsbestätigungszustand."
|
|
;;
|
|
esac
|
|
|
|
run_module "$SCRIPT_DIR/modules/30_runtime_blueprint.sh" "always"
|
|
run_module "$SCRIPT_DIR/modules/40_backend.sh" "always"
|
|
run_module "$SCRIPT_DIR/modules/20_storage.sh" "dry-run-safe"
|
|
run_module "$SCRIPT_DIR/modules/99_finish.sh" "always"
|
|
|
|
log_success "Tuxflotte Installer abgeschlossen"
|