From da22a7af8eb1b3de569fad9ed9f91dc63d7dff35 Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Mon, 9 Jun 2025 14:07:48 -0400 Subject: [PATCH] add initial support for client side quotas --- README.md | 2 ++ data/software_stack/computecanada.yaml | 5 +++++ site/profile/manifests/nfs.pp | 24 +++++++++++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e63a8d522..e624729cb 100644 --- a/README.md +++ b/README.md @@ -899,12 +899,14 @@ This class install NFS and configure an NFS server that will export all volumes | Variable | Description | Type | | :-------- | :----------------------------------------------- | :---------------------------- | | `no_root_squash_tags` | Array of tags identifying instances that can mount NFS exports without root squash | Array[String] | +| `enable_client_quotas` | Enable query of quotas on NFS clients | Boolean |
default values ```yaml profile::nfs::server::no_root_squash_tags: ['mgmt'] +profile::nfs::server::enable_client_quotas: false ```
diff --git a/data/software_stack/computecanada.yaml b/data/software_stack/computecanada.yaml index 0aa999cfe..578cf9ffa 100644 --- a/data/software_stack/computecanada.yaml +++ b/data/software_stack/computecanada.yaml @@ -1,6 +1,11 @@ profile::software_stack::initial_profile: "/cvmfs/soft.computecanada.ca/config/profile/bash.sh" profile::software_stack::lmod_default_modules: - StdEnv/2023 +profile::software_stack::extra_site_env_vars: + CC_CLUSTER: "magic_castle" +lookup_options: + profile::software_stack::extra_site_env_vars: + merge: hash jupyterhub::kernel::venv::python: /cvmfs/soft.computecanada.ca/easybuild/software/2023/%{facts.cpu_microarch}/Compiler/gcccore/python/3.11.5/bin/python jupyterhub::kernel::venv::prefix: /opt/ipython-kernel-computecanada diff --git a/site/profile/manifests/nfs.pp b/site/profile/manifests/nfs.pp index f5adc2cfd..d10f2b484 100644 --- a/site/profile/manifests/nfs.pp +++ b/site/profile/manifests/nfs.pp @@ -69,6 +69,7 @@ class profile::nfs::server ( Array[String] $no_root_squash_tags = ['mgmt'], + Boolean $enable_client_quotas = false, Optional[Array[String]] $export_paths = undef, ) { include profile::volumes @@ -91,7 +92,28 @@ notify => Service[$nfs::server_service_name], } - service { ['rpc-statd', 'rpcbind', 'rpcbind.socket']: + if $enable_client_quotas { + package { 'quota-rpc': + ensure => 'installed', + } + service { 'rpc-rquotad': + ensure => 'running', + enable => true, + require => [Service['rpcbind'], Service['rpcbind.socket'], Package['quota-rpc']] + } + service { ['rpcbind', 'rpcbind.socket']: + enable => true, + notify => Service[$nfs::server_service_name], + } + } + else { + service { ['rpcbind', 'rpcbind.socket']: + ensure => stopped, + enable => mask, + notify => Service[$nfs::server_service_name], + } + } + service { 'rpc-statd': ensure => stopped, enable => mask, notify => Service[$nfs::server_service_name],