From ad5fe4452d8ae5226f0d9bda918b048078b548e0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 19 Jul 2021 13:47:12 -0400 Subject: [PATCH] mgr/nfs: add --squash option to 'nfs export create rgw ...' The cephfs variant already has it. Signed-off-by: Sage Weil --- doc/mgr/nfs.rst | 19 ++++++++++++++++++- src/pybind/mgr/nfs/module.py | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/mgr/nfs.rst b/doc/mgr/nfs.rst index 27a29ea781a..14e0cfc89ac 100644 --- a/doc/mgr/nfs.rst +++ b/doc/mgr/nfs.rst @@ -197,7 +197,7 @@ To export a bucket .. code:: - $ ceph nfs export create rgw [--readonly] [--client_addr ...] [--realm ] + $ ceph nfs export create rgw [--readonly] [--client_addr ...] [--squash ] For example, to export *mybucket* via NFS cluster *mynfs* at the pseudo-path */bucketdata* to any host in the ``192.168.10.0/24`` network @@ -207,6 +207,23 @@ For example, to export *mybucket* via NFS cluster *mynfs* at the pseudo-path */b .. note:: Export creation is supported only for NFS Ganesha clusters deployed using nfs interface. +```` is the name of the bucket that will be exported. + +.. note:: Currently, if multi-site RGW is enabled, Ceph can only export RGW buckets in the default realm. + +```` is the NFS Ganesha cluster ID. + +```` is the export position within the NFS v4 Pseudo Filesystem where the export will be available on the server. It must be an absolute path and unique. + +```` is the list of client address for which these export +permissions will be applicable. By default all clients can access the export +according to specified export permissions. See the `NFS-Ganesha Export Sample`_ +for permissible values. + +```` defines the kind of user id squashing to be performed. The default +value is `no_root_squash`. See the `NFS-Ganesha Export Sample`_ for +permissible values. + Delete Export ------------- diff --git a/src/pybind/mgr/nfs/module.py b/src/pybind/mgr/nfs/module.py index 157ff046fab..04ce5e80925 100644 --- a/src/pybind/mgr/nfs/module.py +++ b/src/pybind/mgr/nfs/module.py @@ -50,12 +50,13 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule): readonly: Optional[bool] = False, client_addr: Optional[List[str]] = None, realm: Optional[str] = None, + squash: str = 'none', ) -> Tuple[int, str, str]: """Create an RGW export""" return self.export_mgr.create_export(fsal_type='rgw', bucket=bucket, realm=realm, cluster_id=cluster_id, pseudo_path=pseudo_path, - read_only=readonly, squash='none', + read_only=readonly, squash=squash, addr=client_addr) @CLICommand('nfs export rm', perm='rw')