Runbook 12 — Client enrollment + per-user NFS share automount¶
Goal: enroll Linux workstations/laptops into FreeIPA (SSO, consistent UID/GID)
and give each user their fileserver home data on demand — as an on-access autofs
share at /var/mnt/shares/<user>, over NFSv4 (sec=sys). /home stays local
(offline-safe) — the workstation role's deliberate design (see §3).
Prereqs: runbooks 10 + 11 validated.
1. Enroll a client into FreeIPA (identity only)¶
On each Linux client (Fedora/Rocky/Ubuntu/Debian — package names vary):
# RHEL-family
dnf -y install ipa-client nfs-utils autofs oddjob-mkhomedir
# Debian/Ubuntu
apt -y install freeipa-client nfs-common autofs libpam-mkhomedir sssd
# point DNS at Unbound (which forwards the IPA zone) BEFORE enrolling
# then:
ipa-client-install \
--domain=${ipa_domain} \
--realm=${realm} \
--server=ipa.${ipa_domain} \
--mkhomedir \
--no-sshd \
--enable-dns-updates
--mkhomedir wires PAM oddjob-mkhomedir so the local home dir is created on
first login. --no-sshd leaves sshd alone — the workstation role (§3) owns SSH-CA
host/user trust on these boxes, not SSSD/IPA's sshd config. Test SSO: id operator,
then su - operator / SSH in with the IPA password → gets a Kerberos ticket
(klist).
2. NFSv4 idmap domain (must match the NFS server)¶
/etc/idmapd.conf:
[General]
Domain = ${ipa_domain}
systemctl restart nfs-idmapd (or rpc.idmapd). Mismatch here =
files show as nobody:nobody.
3. Per-user NFS share — the workstation role (local /home, share at /var/mnt/shares/<user>)¶
Workstations are managed by the OS-agnostic workstation role
(playbooks/workstations.yml), which layers SSH-CA host/user trust + a cert-expiry
metric + the data share + a myos clone auto-pull on top of the IPA enrollment from §1.
The auto-pull (myos-autopull.timer, daily 06:37 + post-boot) does a fetch and ff-only
merge of the interactive user's ~/src/myos — it never touches local work (a dirty or
diverged tree refuses harmlessly and stays put), and only a fetch failure fails the unit
(surfaced by the fleet unit-failed alerting). Added after two stale-clone incidents on
2026-07-25/26 (a 3-week-old yubikey-tool.sh missing admin-hv; an agent session fixing a
live issue on a pre-audit base). Vars: workstation_myos_autopull{,_user,_repo}; a host
without the clone is a clean no-op.
cd ansible && ansible-playbook -i inventory.ini playbooks/workstations.yml -l <host>
The share, not /home:
/homestays LOCAL on workstations — a laptop/desktop must log in and work when the fileserver blips or it's off-LAN. Full NFS/homeis deliberately not used here (rejected alternative below).- Each user's fileserver home is mounted on access at
/var/mnt/shares/<user>→fileserver:/supernas/home/<user>(-fstype=nfs4,rw,soft,_netdev,vers=4.2), and unmounted when idle — so NFS down stalls only/var/mnt/shares, never login. Symlink~/Documentsetc. into it; keep~/.config/~/.cachelocal (dotfiles via chezmoi)./var/mnt/sharesis the one canonical mount path on every box (idiomatic on immutable/ostree, where all writable state lives under/var). - Mutable hosts (Ubuntu/Fedora) get an autofs indirect map
(
/etc/auto.master.d/lab-shares.autofs→/etc/auto.lab-shares); ostree (Fedora Atomic) hosts use a native systemd.automountat the same path. - The IPA
auto.homeovermount guard. FreeIPA ships a defaultauto.homeindirect map at/home; withautomount: sssin nsswitch, autofs would import it via the+auto.masterline and overmount/home, shadowing the local home dirs. The role'sworkstation_autofs_skip_ipa_maps: truecomments out that+auto.masterimport, so autofs manages only/shares(via+dir:/etc/auto.master.d) and the local/homeis left intact.
Rejected alternative — centralized
/homeover NFS (server clients only). A fully centralized/home(FreeIPA'sauto.homemap at/home, so/home/<user>is the NFS mount) is the classic pattern, but it makes login depend on the fileserver being up — unacceptable for roaming/interactive workstations. If you ever want it on a non-workstation always-on server client, setworkstation_autofs_skip_ipa_maps: false(consume IPA's SSS maps), or publish the map centrally:# on FreeIPA: ipa automountlocation-add default ipa automountmap-add default auto.home ipa automountkey-add default auto.home --key='*' \ --info='-fstype=nfs4,sec=sys,rw fileserver.${ipa_domain}:/supernas/home/&' ipa automountkey-add default auto.master --key='/home' --info='auto.home'
4. Login flow check¶
On login as operator: PAM (oddjob-mkhomedir) ensures the local /home/operator
and a Kerberos TGT. Accessing /var/mnt/shares/operator triggers autofs to mount
fileserver:/supernas/home/operator with sec=sys → files owned by operator; going
idle unmounts it. /home itself is never an NFS mount.
Validation¶
- [ ]
id operatorshows the IPA UID/GID on every enrolled client (identical everywhere). - [ ] Login as
operator→/home/operatoris a local dir (mount | grep ' /home 'shows no NFS); the box logs in even with the fileserver down. - [ ] Accessing
/var/mnt/shares/operatormounts the fileserver share (mount | grep sharesshowsnfs4 ... sec=sys), files owned byoperator; it unmounts when idle. - [ ]
/etc/auto.mastershows the+auto.masterimport commented out (IPAauto.homedid not overmount/home). - [ ] Same user on a second workstation sees the same share data.
Then → runbook 13 (Authelia SSO).