Add the four Proxmox hypervisors to the inventory
pfi-pve (Anaheim), nh3-pve (NH), esh-pve + esh-pve-nas (ESH home lab) now have servers/<host>/ entries with ssh-target files, README stubs, and first snapshots. Register all four via add-host.sh + ssh-copy-id; SSH auth is root@<name> with key-based access. Fix a resolver bug in the three workspace scripts: previously, when a hostname resolved via /etc/hosts, resolve_target returned the bare name and ssh dropped the user prefix stored in ssh-target (connecting as the wrong user). Now ssh-target wins whenever it's present, since it can carry user@ or port info that /etc/hosts + ssh_config cannot. Falls back to the dir name only when no ssh-target file exists. CLAUDE.md and README.md split the fleet table into Docker hosts vs hypervisors with an explicit placement rule: don't deploy Docker stacks on PVE hosts; capture host-level detail with server_inspect.sh, use Proxmox-native tooling (qm list, pvesh, zpool) for VM/storage audits.
This commit is contained in:
@@ -71,14 +71,20 @@ for arg in "$@"; do
|
||||
done
|
||||
|
||||
resolve_target() {
|
||||
# ssh-target file wins when present (may carry user@ or non-default port);
|
||||
# /etc/hosts + ssh_config is the fallback.
|
||||
local host="$1"
|
||||
local fb="$SERVERS_DIR/$host/ssh-target"
|
||||
if [ -f "$fb" ]; then
|
||||
local t
|
||||
t=$(awk 'NF{print $1; exit}' "$fb")
|
||||
if [ -n "$t" ]; then echo "$t"; return; fi
|
||||
fi
|
||||
local effective
|
||||
effective=$(ssh -G "$host" 2>/dev/null | awk '/^hostname /{print $2; exit}')
|
||||
if [ -n "$effective" ] && getent hosts "$effective" >/dev/null 2>&1; then
|
||||
echo "$host"; return
|
||||
fi
|
||||
local fb="$SERVERS_DIR/$host/ssh-target"
|
||||
if [ -f "$fb" ]; then awk 'NF{print $1; exit}' "$fb"; return; fi
|
||||
echo "$host"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user