feat(nfs_client): add a role that manages NFS client entries in fstab #451
Open
Dragonish
wants to merge 2 commits from
feat/402-nfs-client into main
pull from: feat/402-nfs-client
merge into: Mortis:main
Mortis:main
Mortis:feat/448-docker-keyring-checksum
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Needs Triage
Maintainer needs to evaluate this issue
Status
Ready for Agent
Fully specified, ready for an AFK agent
Status
Ready for Human
Requires human implementation
Wayfinder
Grilling
Decision ticket resolved in conversation with the maintainer
Wayfinder
Map
Wayfinder map: index of a planning effort and its decision tickets
Wayfinder
Prototype
Decision ticket resolved by reacting to a rough concrete artifact
Wayfinder
Research
Decision ticket resolved by reading outside sources
Wayfinder
Task
Manual work that must happen before a decision can be made
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mortis/Kamino#451
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Adds the
nfs_clientrole proposed in #402: it installsnfs-commonand manages NFS mount entries in/etc/fstab. It never mounts or unmounts anything.Refs #402
nfs_client_mounts(a list ofsrc,path, optionalopts,statepresentorabsent) andnfs_client_default_opts(default_netdev,nofail;x-systemd.automountis left to the host that wants it).chownorchmodthere changes the permissions on the NFS server. A new directory gets the system defaults and an existing one is left as it is.presentwrites the line,absentmaps toansible.posix.mount'sabsent_from_fstab, which removes the line and leaves the share and the directory alone. The module's ownabsentwould also unmount and delete the mount point. A handler reloads systemd after a change.ansible.posix >=2.2.0is already ingalaxy.yml; the pull request only namesnfs_clientin the comment above it.402-nfs-client.yml(minor_changes); the role is added to the role lists inREADME.mdandgalaxy.yml. It is not on the Roadmap list.Verified
yamllintandansible-lint(profileproduction) pass onroles/nfs_client; all commit-stage hooks passed;ansible-test sanitypassed in the pre-push hook;ansible-playbook --syntax-checkpasses for the scenario'sconverge.yml,prepare.ymlandverify.yml.optsfall back correctly, and every refusal carries its own message. This found three defects before the push: the resolved entries were a string, a loopedasserthid its message, and an IPv6 server was rejected.verify.yml(14 cases, run once on localhost in check mode, as in the other roles) each matched their expected message when run against localhost: 14 rescued, 0 failed.ansible.posix.mountbehaviour against a scratch fstab with the same parameters as the role: a seeded line for the same path with another server is replaced once, anabsententry loses its line only (its directory and the file in it stay), and a second pass reportschanged=Falsefor every task.roles/AGENTS.md; its findings are fixed in this branch.fcd2290(run): the whole sequence passed on noble and resolute: syntax, create, prepare, check on a fresh host, converge, check on the configured host, idempotence and verify. That covers thenfs-commoninstall, the fstab fields, the unchanged owner and mode of an existing mount point, nothing mounted, and thedaemon-reloadhandler: systemd has a mount unit for each new entry and none for the removed one. Lint and Build passed too.--checkdoes not refresh them (No package matching 'nfs-common' is available).fcd2290refreshes the cache inprepare.yml, as the docker, pihole, system_baseline and traefik scenarios do.Not verified
x-systemd.automountwere not tried. Debian trixie is untested.NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code
Molecule fails on the first
checkstep on both platforms:No package matching 'nfs-common' is available. Check mode doesn't refresh the apt cache, and the test images ship without package lists, so the install task can't see the package.The other roles that install packages refresh the cache in
prepare.yml(seeroles/docker/molecule/default/prepare.yml). Adding this as the first task ofroles/nfs_client/molecule/default/prepare.ymlshould fix it:Assisted-by: Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.