From 5172c6501ea0b16b0cd8ae4f070a8cebf497f01b Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 6 Aug 2024 10:27:15 +0200 Subject: [PATCH] move static data from params.pp to init.pp This enables puppet-strings to pickup the data and helps to reduce the params.pp size. --- REFERENCE.md | 8 ++++---- manifests/init.pp | 10 +++++----- manifests/params.pp | 5 ----- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index ad547db..407d4e3 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -156,7 +156,7 @@ Data type: `Boolean` Boolean. If set to true, this module will use nfs version 4 for exporting and mounting nfs resources. -Default value: `$nfs::params::nfs_v4` +Default value: `false` ##### `nfs_v4_client` @@ -395,7 +395,7 @@ Data type: `String` String. It defines the location where nfs version 4 exports should be bindmounted to on a server node. Defaults to /export. -Default value: `$nfs::params::nfs_v4_export_root` +Default value: `'/export'` ##### `nfs_v4_export_root_clients` @@ -405,7 +405,7 @@ String. It defines the clients that are allowed to mount nfs version 4 exports a includes the option string. Defaults to *.${::domain}(ro,fsid=root,insecure,no_subtree_check,async,root_squash). -Default value: `$nfs::params::nfs_v4_export_root_clients` +Default value: `"*.${facts['networking']['domain']}(ro,fsid=root,insecure,no_subtree_check,async,root_squash)"` ##### `nfs_v4_mount_root` @@ -414,7 +414,7 @@ Data type: `String` String. It defines the location where nfs version 4 clients find the mount root on a server node. Defaults to /srv. -Default value: `$nfs::params::nfs_v4_mount_root` +Default value: `'/srv'` ##### `nfs_v4_idmap_domain` diff --git a/manifests/init.pp b/manifests/init.pp index 55f61af..6a289e5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -128,7 +128,7 @@ # @param nfs_v4_idmap_nobody_user # String. 'Nobody-User' option for idmapd. Defaults to nobody. # @param nfs_v4_idmap_nobody_group -# String. 'Nobody-Group' option for idmapd. Defaults to nobody or nogroup. +# String. 'Nobody-Group' option for idmapd. Defaults to nobody or nogroup. # @param client_rpcbind_config # String. It defines the location of the file with the rpcbind config. # @param client_rpcbind_optname @@ -169,7 +169,7 @@ Boolean $server_enabled = false, Boolean $client_enabled = false, Boolean $storeconfigs_enabled = true, - Boolean $nfs_v4 = $nfs::params::nfs_v4, + Boolean $nfs_v4 = false, Boolean $nfs_v4_client = $nfs::params::nfs_v4, Stdlib::Absolutepath $exports_file = $nfs::params::exports_file, Stdlib::Absolutepath $idmapd_file = $nfs::params::idmapd_file, @@ -205,9 +205,9 @@ String $client_gssd_options = $nfs::params::client_gssd_options, String $client_gssdopt_name = $nfs::params::client_gssdopt_name, Boolean $client_d9_gssdopt_workaround = false, - String $nfs_v4_export_root = $nfs::params::nfs_v4_export_root, - String $nfs_v4_export_root_clients = $nfs::params::nfs_v4_export_root_clients, - String $nfs_v4_mount_root = $nfs::params::nfs_v4_mount_root, + String $nfs_v4_export_root = '/export', + String $nfs_v4_export_root_clients = "*.${facts['networking']['domain']}(ro,fsid=root,insecure,no_subtree_check,async,root_squash)", + String $nfs_v4_mount_root = '/srv', String $nfs_v4_idmap_domain = $nfs::params::nfs_v4_idmap_domain, Variant[String, Array] $nfs_v4_idmap_localrealms = '', # lint:ignore:params_empty_string_assignment Integer $nfs_v4_idmap_cache = 0, diff --git a/manifests/params.pp b/manifests/params.pp index 416e0c7..d9b187d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -15,11 +15,6 @@ class nfs::params { #### Default values for the parameters of the main module class, init.pp - $nfs_v4 = false - $nfs_v4_export_root = '/export' - $nfs_v4_export_root_clients = "*.${facts['networking']['domain']}(ro,fsid=root,insecure,no_subtree_check,async,root_squash)" - $nfs_v4_mount_root = '/srv' - if $facts['networking']['domain'] != undef { $nfs_v4_idmap_domain = $facts['networking']['domain'] } else {