auberge host rename
Rename a host: remote hostname, hosts.toml entry, and key directory
Synopsis
Section titled “Synopsis”auberge host rename [OPTIONS] [OLD] [NEW]# Alias: auberge h mvDescription
Section titled “Description”Renames a host everywhere its name is load-bearing, in one command:
- Remote:
hostnamectl set-hostname <NEW>and the matching/etc/hostsentries (via sudo over SSH). - Local: the
hosts.tomlentry, the key directory~/.ssh/identities/<OLD>→<NEW>, and the configuredssh_keypath when it points inside that directory. A customssh_keyoutside the derived tree is left untouched — file and path. The generated~/.ssh/config.d/auberge.confis rewritten, sossh <NEW>works immediately (see SSH keys).
If OLD is omitted, you’ll be prompted to select a host, then asked for the new name. If only OLD is given, you’ll be asked for the new name. --yes skips the confirmation, so it requires both names spelled out — a confirmation skipped over a name you never saw is a rename nobody read. Without a terminal and without both names, the command errors and renames nothing.
Preflight bails before touching anything: <OLD> must exist in hosts.toml, <NEW> must not, the key directories must not collide, and SSH to the host must succeed.
Remote steps run first, so a failure there aborts with zero local change. Every step is idempotent: after a partial failure, rerunning the same command is the recovery path (see ADR-0024).
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| OLD | Current host name (omit to be prompted) |
| NEW | New host name (omit to be prompted) |
Options
Section titled “Options”| Option | Description |
|---|---|
-y, --yes |
Skip confirmation (requires both names) |
Not done by this command
Section titled “Not done by this command”- tailscale: the host re-advertises itself under the new name and releases the old tailnet name.
- restic: snapshots group by host name — the old lineage freezes at the rename and the new name starts a fresh one. Never rewrite snapshot tags.
Examples
Section titled “Examples”# Rename with confirmation promptauberge host rename auberge vieille-auberge
# Pick the host, then type the new nameauberge host rename
# Name the host, type the new nameauberge host rename auberge
# Non-interactive (ceremony scripts) — both names requiredauberge host rename auberge vieille-auberge --yes