setup for peers
This commit is contained in:
1 parent
b53ab9c854
commit
53e272367e
8 files changed
+73
-29
No files matched your search
+1
-1
@@ -37,7 +37,7 @@ bin/
|
||||
| `skyg os rollback` | Roll back to previous generation |
|
||||
| `skyg remote switch <host>` | Deploy to a remote host |
|
||||
| `skyg remote install <host>` | Fresh-install a remote host via nixos-anywhere, using `hosts/<profile>.disko.nix`. Always wipes the disks in that file. Aborts if the file is missing, if the host already boots NixOS from disk (unless `--force-wipe`), or if you do not type the short hostname. |
|
||||
| `skyg remote status <host>` | Check status of a single remote host: booted / current / next-boot generation. `reboot_pending` = booted != next boot (`/nix/var/nix/profiles/system`), `needs_build` = local build != next boot. So hosts deployed with `boot` show up correctly. |
|
||||
| `skyg remote status <host>` | Check status of a single remote host: booted / current / next-boot generation. `reboot_pending` = booted != next boot (`/nix/var/nix/profiles/system`), `needs_build` = local build != next boot (or `"unknown"` if the local eval fails). So hosts deployed with `boot` show up correctly. |
|
||||
| `skyg remote status --all` | Check status of all remote hosts |
|
||||
| `skyg remote boot-all` | Boot all remote hosts |
|
||||
| `skyg remote reboot-pending` | Reboot every remote host with a pending reboot (`booted-system` != next-boot generation, so `boot` deploys count). Lists them, asks for confirmation, then reboots one at a time. Each host must prove it rebooted (boot id changed) and come back on its next-boot generation, otherwise it is reported as failed. Sends a desktop notification per host. |
|
||||
|
||||
+8
-3
@@ -140,7 +140,7 @@ Starting parallel boots (concurrency: 2)..."
|
||||
let boot_results = ($online_hosts | par-each --threads 1 { |host|
|
||||
let target_host = $"root@($host).lab.internal"
|
||||
let profile = $"hl-($host)"
|
||||
let runcmd = $"nh os boot --target-host ($target_host) .#($profile)"
|
||||
let runcmd = $"nh os boot --no-nom --target-host ($target_host) .#($profile)"
|
||||
print $runcmd
|
||||
let ok = (try {
|
||||
bash -c $runcmd
|
||||
@@ -214,8 +214,13 @@ export def "skyg remote status-all" [] {
|
||||
let current = (if ($info.current | is-empty) { "-" } else { $info.current | path basename })
|
||||
let next_boot = (if ($info.next_boot | is-empty) { "-" } else { $info.next_boot | path basename })
|
||||
let reboot_line = if $info.reboot_pending { $"(ansi yellow)REBOOT PENDING(ansi reset)\n" } else { "" }
|
||||
let build_line = if $info.needs_build { $"(ansi red)NEEDS NEW BUILD(ansi reset)" } else { $"(ansi green)UP TO DATE(ansi reset)" }
|
||||
print $"($host) | Booted: ($booted) | Current: ($current) | Next boot: ($next_boot)"
|
||||
# needs_build is true, false, or "unknown" (local eval failed)
|
||||
let build_line = match $info.needs_build {
|
||||
true => $"(ansi red)NEEDS NEW BUILD(ansi reset)",
|
||||
false => $"(ansi green)UP TO DATE(ansi reset)",
|
||||
_ => $"(ansi yellow)BUILD UNKNOWN (eval failed)(ansi reset)",
|
||||
}
|
||||
print $"($host) | Booted: ($booted) | Current: ($current) | Next boot: ($next_boot)\n ($reboot_line)($build_line)"
|
||||
|
||||
$info
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user