feat(post-install): identity_network reboote et rebascule l'IP en BDD (tâche 4)
- updateMachine accepte name/hostname/port (correction d'identité réseau) - rebootAndRebind : reboot sur l'ancienne connexion → attente du retour sur la NOUVELLE IP (verifyReboot avec host cible) → maj BDD (hostname + nom) si OK. Sécurité : BDD inchangée si la machine ne revient pas (récupération console/backups) - execute post_install : si identity_network + reboot coché + succès, déclenche rebootAndRebind et joint le RebootResult ; statut error si reconnexion échoue tsc 0 · 113 tests · build OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,9 @@ function toView(m: MachineRow): MachineView {
|
||||
}
|
||||
|
||||
export interface UpdateMachineInput {
|
||||
name?: string;
|
||||
hostname?: string;
|
||||
port?: number;
|
||||
osFamily?: OsFamily;
|
||||
machineKind?: MachineKind;
|
||||
virtualization?: string | null;
|
||||
@@ -48,11 +51,14 @@ export interface UpdateMachineInput {
|
||||
aptProxyUrl?: string | null;
|
||||
}
|
||||
|
||||
/** Met à jour les champs de profil/proxy d'une machine (jamais les secrets). */
|
||||
/** Met à jour les champs de profil/proxy/identité d'une machine (jamais les secrets). */
|
||||
export function updateMachine(id: string, input: UpdateMachineInput): MachineView {
|
||||
const row = getMachineRow(id);
|
||||
if (!row) throw new Error("Machine introuvable");
|
||||
const patch: Partial<MachineRow> = { updatedAt: new Date().toISOString() };
|
||||
if (input.name !== undefined) patch.name = input.name;
|
||||
if (input.hostname !== undefined) patch.hostname = input.hostname;
|
||||
if (input.port !== undefined) patch.port = input.port;
|
||||
if (input.osFamily !== undefined) patch.osFamily = input.osFamily;
|
||||
if (input.machineKind !== undefined) patch.machineKind = input.machineKind;
|
||||
if (input.virtualization !== undefined) patch.virtualization = input.virtualization;
|
||||
|
||||
Reference in New Issue
Block a user