Supporting fuse as a filesystem type in mount module

Dear Ansible list,

A project I’m working on uses the moderately widely used open source tool s3fs-fuse to mount an AWS S3 bucket as a FUSE filesystem (https://github.com/s3fs-fuse/s3fs-fuse). With s3fs-fuse, you can interact with the contents of an s3 bucket as if it’s a local filesystem, and you set it up by adding a line like the following in fstab:


s3fs#mybucket /path/to/mountpoint fuse _netdev,allow_other 0 0


I tried to use the mount role to add that fstab entry, but it looks like mount hands off validation of the to the filesystem module, which checks against a list of filesystems (https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/modules/system/filesystem.py#L321) and rejects any unfamiliar ones.


failed: [use1-base-vi-api-preview-ami.bf-aws.illumina.com] (item={'value': {u'mount_point': {u'owner': u'ec2-user', u'group': u'ec2-user', u'ec2-user': u'/s3bucket', u'mode': u'0755'}, u'force': False, u'fstype': u'fuse', u'volume': u's3fs#mybucket', u'resizefs': False, u'state': u'present', u'opts': u'allow_other,uid=ec2-user,gid=ec2-user,iam_role=<role>,nonempty,_netdev 0 0'}, 'key': u's3fs_bucket'}) => { "changed": false, "invocation": { "module_args": { "dev": "s3fs#mybucket", "force": false, "fstype": "fuse", "resizefs": false } }, "item": { "key": "s3fs_bucket", "value": { "force": false, "fstype": "fuse", "mount_point": { "group": "ec2-user", "mode": "0755", "name": "/s3bucket", "owner": "ec2-user" }, "opts": "allow_other,uid=ec2-user,gid=ec2-user,iam_role=<role>,nonempty,_netdev 0 0", "resizefs": false, "state": "present", "volume": "s3fs#mybucket" } }, "msg": "value of fstype must be one of: ext4, ext3, ext2, btrfs, vfat, ocfs2, ext4dev, reiserfs, lvm, xfs, got: fuse"

I can think of three options here:

  1. Just write a handler in my little ansible role for managing mountpoints to use lineinfile and command instead of the mount module if the fstype value is fuse
  2. Figure out how that argument validation is happening and update the mount module so it doesn’t hand the argument validation off to filesystem if the value given for fstype is fuse (either locally in my playbook repo or by making a PR back
  3. Add support for this fuse type to the filesystem module

There are various different applications that implement filesystems in FUSE and it’s shipped as part of the Linux kernel, so it seems to me like it’d be moderately useful for the mount module to support fuse.

It doesn’t seem useful for the filesystem module to support it to me: the point of FUSE is for userspace applications to expose a filesystem through means of their own, and any formatting or configuration or other wrangling of that filesystem should be done by the application who provides it.

Curious if this use case has come up before for anyone, and how they handled it - and is there a reference page somewhere that explains how that argument validation handoff happens? If it’d be generically useful I will have a look at figuring out how to let the mount module support this config.

(Apologies if this should be a github issue instead - I see there’s a great module migration going on and was not quite sure where would be best to post!)

thanks
Nikki