We already have a mount module for managing ftstab entries and it’s not a good idea to have two modules handling the same file. I am with Brian on this.
We do have a filesystem module but it does not handle swap but may be changed to do so. I partially agree with Brian that this module can be modified as to create swap partitions with mkswap and swapon, but one things the module doesn’t do is to remove filesystems. This makes sense because we don’t usually remove filesystems but it is possible to remove swap partitions without having a serious problem.
I also really like a feature and find very useful that creates swaps to make a build on cloud VM and destroy that swap after I’m done. I would like keep that feature is possible.
I understand the need for controlling the module sprawl and integrating features on existing ones but I’m not sure using filesystem module is a good idea, (especially editing it to support removal of filesystems).
Brian (bcoca) had made two points:
1. We already have a mount module for managing ftstab entries and it's
not
a good idea to have two modules handling the same file. I am with Brian
on
this.
+1
2. We do have a filesystem module but it does not handle swap but may be
changed to do so. I partially agree with Brian that this module can be
modified as to create swap partitions with mkswap and swapon, but one
things the module doesn't do is to remove filesystems. This makes sense
because we don't usually remove filesystems but it is possible to remove
swap partitions without having a serious problem.
I'm in favor of adding a 'state' property to the filesystem module. I'm
not sure how we're dealing with unimplemented features but you could
focus on swap and raise an warning/exception for other types.
I also really like a feature and find very useful that creates swaps to
make a build on cloud VM and destroy that swap after I'm done. I would
like
keep that feature is possible.
By not making it permanent, right? IMHO, another property for the
filesystem module.
Otherwise, it wouldn't use it as swap after a reboot but it will still
remain in the fs, occupying space.
There's one more thing to consider, if the user removes a swap but doesn't
remove the entry from fstab, the machine will err on boot since it can't
find the file/device it's supposed to mount. Any ideas?
I expect any user dealing with fstab to be aware of the pitfalls of
creating broken entries. I know you created this for a very specific
use, but it should be just as easy to create a role that takes care of
doing it correctly instead of internalizing it all in a single module.
Also the file module can be used to remove the swap file, it already
has state=absent.