diff --git a/ncm-metaconfig/src/main/metaconfig/ganesha/2.2/tests/profiles/attribute.pan b/ncm-metaconfig/src/main/metaconfig/ganesha/2.2/tests/profiles/attribute.pan index 3cc10358ad..fda515a857 100644 --- a/ncm-metaconfig/src/main/metaconfig/ganesha/2.2/tests/profiles/attribute.pan +++ b/ncm-metaconfig/src/main/metaconfig/ganesha/2.2/tests/profiles/attribute.pan @@ -113,7 +113,7 @@ prefix "/metaconfig/contents/main/test"; "Enable_RQUOTA" = true; "MNT_Port" = 0; "MNT_Program" = 100005; -"Manage_Gids_Expiration" = 30*60; +"Manage_Gids_Expiration" = 30 * 60; "MaxRPCRecvBufferSize" = 1048576; "MaxRPCSendBufferSize" = 1048576; "NFS_Port" = 2049; diff --git a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/config_v1.pan b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/config_v1.pan index 7f52c0770d..c2e8c2d8cb 100644 --- a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/config_v1.pan +++ b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/config_v1.pan @@ -1,7 +1,7 @@ unique template metaconfig/ganesha/config_v1; variable GANESHA_FSAL ?= undef; -variable GANESHA_SERVICE ?= format('nfs-ganesha-%s',GANESHA_FSAL); +variable GANESHA_SERVICE ?= format('nfs-ganesha-%s', GANESHA_FSAL); variable GANESHA_MANAGES_GANESHA ?= true; include 'metaconfig/ganesha/schema'; @@ -9,9 +9,8 @@ include 'metaconfig/ganesha/schema'; bind "/software/components/metaconfig/services/{/etc/ganesha/ganesha.nfsd.conf}/contents" = ganesha_config; prefix "/software/components/metaconfig/services/{/etc/ganesha/ganesha.nfsd.conf}"; -"daemons" = {if(GANESHA_MANAGES_GANESHA) {dict(GANESHA_SERVICE, "restart")} else {null};}; +"daemons" = if(GANESHA_MANAGES_GANESHA) dict(GANESHA_SERVICE, "restart") else null; "module" = "ganesha/1.5/main"; prefix "/software/components/metaconfig/services/{/etc/ganesha/ganesha.nfsd.conf}/contents/main"; 'SNMP_ADM/snmp_adm_log' = '/var/log/ganesha_snmp_adm.log'; - diff --git a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/config_v2.pan b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/config_v2.pan index 21150ca75d..f6585162cf 100644 --- a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/config_v2.pan +++ b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/config_v2.pan @@ -8,6 +8,5 @@ include 'metaconfig/ganesha/schema_v2'; bind "/software/components/metaconfig/services/{/etc/ganesha/ganesha.conf}/contents" = ganesha_v2_config; prefix "/software/components/metaconfig/services/{/etc/ganesha/ganesha.conf}"; -"daemons" = {if(GANESHA_MANAGES_GANESHA) {dict(GANESHA_SERVICE, "restart")} else {null};}; +"daemons" = if(GANESHA_MANAGES_GANESHA) dict(GANESHA_SERVICE, "restart") else null; "module" = "ganesha/2.2/main"; - diff --git a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/fsal/gpfs.pan b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/fsal/gpfs.pan index 183436f163..667ecacca5 100644 --- a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/fsal/gpfs.pan +++ b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/fsal/gpfs.pan @@ -13,15 +13,15 @@ prefix "/software/components/metaconfig/services/{/etc/ganesha/ganesha.nfsd.conf "CacheInode/Symlink_Expiration_Time" = 120; "CacheInode/Directory_Expiration_Time" = 120; -"CacheInode_GC_Policy/Entries_HWMark" = 1500*256*GANESHA_GPFS_MULTIPLIER; -"CacheInode_GC_Policy/Entries_LWMark" = 1000*256*GANESHA_GPFS_MULTIPLIER; +"CacheInode_GC_Policy/Entries_HWMark" = 1500 * 256 * GANESHA_GPFS_MULTIPLIER; +"CacheInode_GC_Policy/Entries_LWMark" = 1000 * 256 * GANESHA_GPFS_MULTIPLIER; "CacheInode_GC_Policy/LRU_Run_Interval" = 90; "CacheInode_GC_Policy/FD_HWMark_Percent" = 60; "CacheInode_GC_Policy/FD_LWMark_Percent" = 20; "CacheInode_GC_Policy/FD_Limit_Percent" = 90; "CacheInode_GC_Policy/Reaper_Work" = 15000; -"NFS_Core_Param/Nb_Worker" = 128*GANESHA_GPFS_MULTIPLIER; +"NFS_Core_Param/Nb_Worker" = 128 * GANESHA_GPFS_MULTIPLIER; "NFS_Core_Param/MNT_Port" = 32767; "NFS_Core_Param/NLM_Port" = 32769; "NFS_Core_Param/RQOTA_Port" = null; # no rqouta on gpfs @@ -29,4 +29,3 @@ prefix "/software/components/metaconfig/services/{/etc/ganesha/ganesha.nfsd.conf "NFS_Core_Param/Clustered" = true; "SNMP_ADM/export_cache_inode_calls_detail" = null; # not for gpfs - diff --git a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/schema.pan b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/schema.pan index 29807345b6..7ea1003c41 100644 --- a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/schema.pan +++ b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/schema.pan @@ -2,9 +2,9 @@ declaration template metaconfig/ganesha/schema; # the defaults are based on the GPFS FSAL -type ganesha_nfs_protocol = long with SELF == 2 || SELF == 3 || SELF == 4; -type ganesha_transport_protocol = string with SELF == 'TCP' || SELF == 'UDP'; -type ganesha_sec_type = string with SELF == 'sys' || SELF == 'krb5' || SELF == 'krb5i' || SELF == 'krb5p'; +type ganesha_nfs_protocol = long(2..4); +type ganesha_transport_protocol = choice('TCP', 'UDP'); +type ganesha_sec_type = choice('sys', 'krb5', 'krb5i', 'krb5p'); type ganesha_export_client = { "Root_Access" ? string[] # Grant root access to thoses nodes, networks and @netgroups. A hostname can contain wildcards (*?). @@ -86,7 +86,7 @@ type ganesha_filesystem = { } = dict(); type ganesha_GPFS = { - # no GPFS specific options + # no GPFS specific options } = dict(); type ganesha_cacheinode_hash = { @@ -197,7 +197,7 @@ type ganesha_nfs_core_param = { "MaxRPCSendBufferSize" ? long(0..) = 32768 # The size of each RPC send buffer in bytes and effectively the maximum send size. "MaxRPCRecvBufferSize" ? long(0..) = 32768 # The size of each RPC receive buffer in bytes and effectively the maximum receive size. - "NFS_Protocols" ? ganesha_nfs_protocol[] = list(3,4) # List of NFS Protocol Versions that should be supported + "NFS_Protocols" ? ganesha_nfs_protocol[] = list(3, 4) # List of NFS Protocol Versions that should be supported } = dict(); type ganesha_nfs_dupreq_hash = { diff --git a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/schema_v2.pan b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/schema_v2.pan index c9f0b40bed..45208523c7 100644 --- a/ncm-metaconfig/src/main/metaconfig/ganesha/pan/schema_v2.pan +++ b/ncm-metaconfig/src/main/metaconfig/ganesha/pan/schema_v2.pan @@ -7,13 +7,13 @@ declaration template metaconfig/ganesha/schema_v2; include 'pan/types'; final variable GANESHA_V2_LOG_COMPONENTS = list( -'ALL', 'LOG', 'LOG_EMERG', 'MEMLEAKS', 'FSAL', 'NFSPROTO', -'NFS_V4', 'EXPORT', 'FILEHANDLE', 'DISPATCH', 'CACHE_INODE', -'CACHE_INODE_LRU', 'HASHTABLE', 'HASHTABLE_CACHE', 'DUPREQ', -'INIT', 'MAIN', 'IDMAPPER', 'NFS_READDIR', 'NFS_V4_LOCK', -'CONFIG', 'CLIENTID', 'SESSIONS', 'PNFS', 'RW_LOCK', 'NLM', -'RPC', 'NFS_CB', 'THREAD', 'NFS_V4_ACL', 'STATE', '9P', -'9P_DISPATCH', 'FSAL_UP', 'DBUS' + 'ALL', 'LOG', 'LOG_EMERG', 'MEMLEAKS', 'FSAL', 'NFSPROTO', + 'NFS_V4', 'EXPORT', 'FILEHANDLE', 'DISPATCH', 'CACHE_INODE', + 'CACHE_INODE_LRU', 'HASHTABLE', 'HASHTABLE_CACHE', 'DUPREQ', + 'INIT', 'MAIN', 'IDMAPPER', 'NFS_READDIR', 'NFS_V4_LOCK', + 'CONFIG', 'CLIENTID', 'SESSIONS', 'PNFS', 'RW_LOCK', 'NLM', + 'RPC', 'NFS_CB', 'THREAD', 'NFS_V4_ACL', 'STATE', '9P', + '9P_DISPATCH', 'FSAL_UP', 'DBUS', ); @{ Ganesha 9p protocol section @} @@ -57,7 +57,7 @@ type ganesha_v2_export_FSAL = { #"FSAL" ? ganesha_v2_export_FSAL #FSAL_VFS "pnfs" ? boolean = false - "fsid_type" ? string with match(SELF, '^(None|One64|Major64|Two64|uuid|Two32|Dev|Device)$') + "fsid_type" ? choice('None', 'One64', 'Major64', 'Two64', 'uuid', 'Two32', 'Dev', 'Device') #FSAL_GLUSTER "glfs_log" ? string = "/tmp/gfapi.log" "hostname" ? string # Mandatory @@ -71,16 +71,17 @@ type ganesha_v2_export_FSAL = { "PNFS" ? ganesha_v2_export_FSAL_PNFS }; -type ganesha_v2_protocol = string with match(SELF, '^((NFS)?[vV]?[34]|9P)$'); -type ganesha_v2_SecType = string with match(SELF, '^(none|sys|krb5[ip]?)$'); -type ganesha_v2_Transports = string with match(SELF, '^(UDP|TCP)$'); +type ganesha_v2_protocol = choice('3', '4', 'NFS3', 'NFS4', 'V3', 'V4', 'NFSv3', 'NFSv4', '9P'); +type ganesha_v2_SecType = choice('none', 'sys', 'krb5', 'krb5i', 'krb5p'); +type ganesha_v2_Transports = choice('UDP', 'TCP'); +type ganesha_v2_delegations = choice('None', 'read', 'write', 'readwrite', 'r', 'w', 'rw'); @{ Ganesha Export Permissions for EXPORT_DEFAULLTS, EXPORT and CLIENT sections @} type ganesha_v2_export_permissions = { - "Access_Type" ? string = 'None' with match(SELF, '^(None|RW|RO|MDONLY|MDONLY_RO)$') + "Access_Type" ? choice('None', 'RW', 'RO', 'MDONLY', 'MDONLY_RO') = 'None' "Anonymous_gid" ? long = -2 "Anonymous_uid" ? long = -2 - "Delegations" ? string with match(SELF, '^(None|read|write|readwrite|r|w|rw)$') + "Delegations" ? ganesha_v2_delegations "Disable_ACL" ? boolean = false "DisableReaddirPlus" ? boolean = false "Manage_Gids" ? boolean = false @@ -88,8 +89,22 @@ type ganesha_v2_export_permissions = { "PrivilegedPort" ? boolean = false "Protocols" ? ganesha_v2_protocol[] = list('3', '4', '9P') "SecType" ? ganesha_v2_SecType[] = list('none', 'sys') - "Squash" ? string = "root_squash" with match(SELF, - '^((root|all)(_?squash)?|no_root_squash|none|noidsquash)$') + "Squash" ? choice( + 'root', + 'root_squash', + 'rootsquash', + 'rootid', + 'root_id_squash', + 'rootidsquash', + 'all', + 'all_squash', + 'allsquash', + 'all_anomnymous', + 'allanonymous', + 'no_root_squash', + 'none', + 'noidsquash' + ) = "root_squash" "Transports" ? ganesha_v2_Transports[] = list('UDP', 'TCP') "Trust_Readdir_Negative_Cache" ? boolean = false }; @@ -129,23 +144,47 @@ type ganesha_v2_exports = { "UseCookieVerifier" ? boolean = true }; -type ganesha_v2_log_level = string with match(SELF, - '^(NULL|FATAL|MAJ|CRIT|WARN|EVENT|INFO|DEBUG|MID_DEBUG|M_DBG|FULL_DEBUG|F_DBG)$'); +type ganesha_v2_log_level = choice( + 'NULL', + 'FATAL', + 'MAJ', + 'CRIT', + 'WARN', + 'EVENT', + 'INFO', + 'DEBUG', + 'MID_DEBUG', + 'M_DBG', + 'FULL_DEBUG', + 'F_DBG' +); @{ Check for valid Ganesha Log Component names @} function is_ganesha_v2_log_Components = { components = ARGV[0]; foreach(cmp; logl; components) { if(index(cmp, GANESHA_V2_LOG_COMPONENTS) == -1) { - error(format("%s is not a valid Ganesha Log Component !", cmp)); + error("%s is not a valid Ganesha Log Component !", cmp); return(false); }; }; }; type ganesha_v2_log_Components = ganesha_v2_log_level{} with is_ganesha_v2_log_Components(SELF); -type ganesha_v2_log_time_format = string with match(SELF, - '^(ganesha|true|local|8601|ISO-8601|ISO 8601|ISO|syslog|syslog_usec|false|none|user_defined)$'); +type ganesha_v2_log_time_format = choice( + 'ganesha', + 'true', + 'local', + '8601', + 'ISO-8601', + 'ISO 8601', + 'ISO', + 'syslog', + 'syslog_usec', + 'false', + 'none', + 'user_defined' +); @{ Ganesha Log Format subsection @} type ganesha_v2_log_Format = { @@ -170,8 +209,8 @@ type ganesha_v2_log_Format = { @{ Ganesha Log Facility subsection @} type ganesha_v2_log_Facility = { "destination" : string - "enable" ? string = 'idle' with match(SELF, '^(idle|active|default)$') - "headers" ? string = 'all' with match(SELF, '^(none|component|all)$') + "enable" ? choice('idle', 'active', 'default') = 'idle' + "headers" ? choice('none', 'component', 'all') = 'all' "max_level" ? ganesha_v2_log_level = 'FULL_DEBUG' "name" ? string }; @@ -280,7 +319,7 @@ type ganesha_v2_proxy_remote_server = { "RPC_Client_Timeout" ? long(0..) = 60 "Remote_PrincipalName" ? string "Retry_SleepTime" ? long(0..) = 10 - "Sec_Type" ? string = 'krb5' with match(SELF, '^krb5[ip]?$') + "Sec_Type" ? choice('none', 'krb5', 'krb5i', 'krb5p') = 'krb5' "Srv_Addr" ? type_ip = "127.0.0.1" "Use_Privileged_Client_Port" ? boolean = false }; @@ -311,7 +350,7 @@ type ganesha_v2_proxy = { @{ Ganesha GPFS section @} type ganesha_v2_GPFS = { include ganesha_v2_fsalsettings_all - "Delegations" ? string with match(SELF, '^(None|read|write|readwrite|r|w|rw)$') + "Delegations" ? ganesha_v2_delegations "fsal_grace" ? boolean = false "fsal_trace" ? boolean = true "pnfs_file" ? boolean = false