HASH 36f875c44503
DATE 2025-05-06
SUBJECT virtualization: add ssh key cleanup to vm script
FILES 1 CHANGED
HASH 36f875c44503
DATE 2025-05-06
SUBJECT virtualization: add ssh key cleanup to
vm script
FILES 1 CHANGED
┌─ modules/nixos/workstation/virtualization/ooknet-install-vm.nix ───────────┐
│ diff --git a/modules/nixos/workstation/virtualization/ooknet-install-vm.nix b/modu │
│ les/nixos/workstation/virtualization/ooknet-install-vm.nix │
│ index 6779969..2cb45e4 100644 │
│ --- a/modules/nixos/workstation/virtualization/ooknet-install-vm.nix │
│ +++ b/modules/nixos/workstation/virtualization/ooknet-install-vm.nix │
│ @@ -223,6 +223,12 @@ in { │
│ log info "VM successfully removed..." │
│ } │
│ │
│ + destroyHostKey() { │
│ + log info "Cleaning up old host keys..." │
│ + ssh-keygen -R ${cfg.ipAddress} >2/dev/null || true │
│ + ssh-keygen -R ${cfg.name} >2/dev/null || true │
│ + } │
│ + │
│ startVM() { │
│ local vm_state │
│ vm_state=$(virsh domstate "$NAME" 2>/dev/null || echo "unknown") │
│ @@ -256,10 +262,12 @@ in { │
│ "Delete") │
│ destroyVM │
│ destroyNetwork │
│ + destroyHostKey │
│ ;; │
│ "Build New") │
│ destroyVM │
│ destroyNetwork │
│ + destroyHostKey │
│ buildVM │
│ ;; │
│ "Start") │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...ization/ooknet-install-vm.nix ───┐
│ diff --git a/modules/nixos/workstation/virtu │
│ alization/ooknet-install-vm.nix b/modules/ni │
│ xos/workstation/virtualization/ooknet-instal │
│ l-vm.nix │
│ index 6779969..2cb45e4 100644 │
│ --- a/modules/nixos/workstation/virtualizati │
│ on/ooknet-install-vm.nix │
│ +++ b/modules/nixos/workstation/virtualizati │
│ on/ooknet-install-vm.nix │
│ @@ -223,6 +223,12 @@ in { │
│ log info "VM successfully remov │
│ ed..." │
│ } │
│ │
│ + destroyHostKey() { │
│ + log info "Cleaning up old host │
│ keys..." │
│ + ssh-keygen -R ${cfg.ipAddress} │
│ >2/dev/null || true │
│ + ssh-keygen -R ${cfg.name} >2/de │
│ v/null || true │
│ + } │
│ + │
│ startVM() { │
│ local vm_state │
│ vm_state=$(virsh domstate "$NAM │
│ E" 2>/dev/null || echo "unknown") │
│ @@ -256,10 +262,12 @@ in { │
│ "Delete") │
│ destroyVM │
│ destroyNetwork │
│ + destroyHostKey │
│ ;; │
│ "Build New") │
│ destroyVM │
│ destroyNetwork │
│ + destroyHostKey │
│ buildVM │
│ ;; │
│ "Start") │
└──────────────────────────────────────────────┘
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET