Looking over the code, the documentation, and the code comments there seems to be a disconnect around what to do for each state.
The Documentation for state:
absent = remove from fstab, DO remove mount point, do NOT unmount ( removing an active mount point isn’t possible )
present = add to fstab, do NOT create mount point, do NOT mount
mounted = add to fstab, create mount point, mount
unmounted = remove from fstab, unmount
The Code Comments for state:
absent = remove from fstab, unmount
present = add to fstab ( no mention of creating the mount point )
mounted = add to fstab, create mount point (if needed), mount (remount if existing changed)
unmounted = do NOT remove from fstab, unmount
The Code actions for state:
absent = remove from fstab, unmount, remove mount point
present = add to fstab (this does not create a mount point so subsequent commands or reboots could error on this line)
mounted = create mount point (if needed), add to fstab, mount (remount if existing and changed)
unmounted = unmount (this leaves the fstab file unchanged. subsequent commands or reboots will remount this)
The code is easy to change, but I’m looking for input on the right actions. My suggestion is to follow most of the documented actions ( I can correct the docs at the same time ).
absent = remove from fstab
present = add to fstab
mounted = add to fstab, create mount point (if needed), mount (remount is existing and changed)
unmount = remove from fstab, unmount, remove mount point
thoughts?
For mounted and unmounted