mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-28 13:57:43 +00:00
Root cause of the kernel-flavor swarm ENOENT: no export carried fsid=0, so the NFSv4 mount of the nested /srv/nfs/infinito-state sub-export had no pseudo-root anchor and the server returned NFS4ERR_NOENT on the PUTROOTFH+LOOKUP walk. crossmnt could not fix it (it only crosses a boundary mid-walk, never sets the starting filehandle). Kernel now exports the state dir itself at fsid=0 and clients mount the bare v4 root ':/' (zero LOOKUPs). ganesha keeps Pseudo=Path and v3 mounts the full path. The self-bind is kept so fsid=0 rides a real mount boundary (stable st_dev) under overlayfs DinD. The NFS derivations move to per-value lookup plugins (nfs_flavor, nfs_client_src, nfs_fstype, nfs_mount_opts, nfs_state_path) backed by pure helpers in utils/storage/nfs.py with unit tests; group_vars STORAGE_NFS_* become thin lookup wrappers. The dev/act->ganesha flavor rule stays the single SPOT in the role config; nfs_flavor reads the merged value so client and server agree. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
780 B
Python
26 lines
780 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import PurePosixPath
|
|
|
|
|
|
def state_path(export_base, subdir):
|
|
return str(PurePosixPath(str(export_base)) / str(subdir))
|
|
|
|
|
|
def fstype(version):
|
|
return "nfs4" if int(version) >= 4 else "nfs"
|
|
|
|
|
|
def mount_opts(version, runtime):
|
|
reliability = (
|
|
"soft,timeo=50,retrans=3" if runtime in ("dev", "act") else "hard,timeo=600"
|
|
)
|
|
return f"vers={version},rw,{reliability},nolock"
|
|
|
|
|
|
def client_src(server, version, flavor, state_path_value):
|
|
# kernel-v4 exports the state dir at fsid=0, so clients mount the bare ':/' root;
|
|
# ganesha (Pseudo == real path) and v3 mount the full state path.
|
|
use_root = flavor == "kernel" and int(version) >= 4
|
|
return f"{server}:{'/' if use_root else state_path_value}"
|