Puppet Class: nfs

Inherits:
nfs::params
Defined in:
manifests/init.pp

Overview

Class: nfs::init

Parameters:

  • ensure (Enum['present', 'absent', 'running', 'stopped', 'disabled']) (defaults to: 'present')

    String. Controls if the managed resources shall be present or absent. If set to absent:

    • The managed software packages are being uninstalled.

    • Any traces of the packages will be purged as good as possible. This may include existing configuration files. The exact behavior is provider dependent. Q.v.:

    • System modifications (if any) will be reverted as good as possible (e.g. removal of created users, services, changed log settings, …).

    • This is thus destructive and should be used with care.

    Defaults to present.

  • server_enabled (Boolean) (defaults to: false)

    Boolean. If set to true, this module will configure the node to act as a nfs server.

  • client_enabled (Boolean) (defaults to: false)

    Boolean. If set to true, this module will configure the node to act as a client server, you can use the exported mount resources from configured servers.

  • storeconfigs_enabled (Boolean) (defaults to: true)

    Boolean. If set to false, this module will not export any resources as storeconfigs. Defaults to true.

  • nfs_v4 (Boolean) (defaults to: false)

    Boolean. If set to true, this module will use nfs version 4 for exporting and mounting nfs resources.

  • nfs_v4_client (Boolean) (defaults to: false)

    Boolean. If set to true, this module will use nfs version 4 for mounting nfs resources. If set to false it will use nfs version 3 to mount nfs resources. It defaults to the setting of @param nfs_v4

  • exports_file (Stdlib::Absolutepath) (defaults to: $nfs::params::exports_file)

    String. It defines the location of file with the nfs export resources used by the nfs server.

  • idmapd_file (Stdlib::Absolutepath) (defaults to: $nfs::params::idmapd_file)

    String. It defines the location of the file with the idmapd settings.

  • defaults_file (Optional[Stdlib::Absolutepath]) (defaults to: $nfs::params::defaults_file)

    String. It defines the location of the file with the nfs settings.

  • manage_packages (Boolean) (defaults to: true)

    Boolean. It defines if the packages should be managed through this module

  • server_packages (Array) (defaults to: $nfs::params::server_packages)

    Array. It defines the packages needed to be installed for acting as a nfs server

  • server_package_ensure (String) (defaults to: 'installed')

    String. It defines the packages state - any of present, installed, absent, purged, held, latest

  • client_packages (Array) (defaults to: $nfs::params::client_packages)

    Array. It defines the packages needed to be installed for acting as a nfs client

  • client_package_ensure (String) (defaults to: 'installed')

    String. It defines the packages state - any of present, installed, absent, purged, held, latest

  • manage_server_service (Boolean) (defaults to: true)

    Boolean. Defines if module should manage server_service

  • manage_server_servicehelper (Boolean) (defaults to: true)

    Boolean. Defines if module should manage server_servicehelper

  • manage_client_service (Boolean) (defaults to: true)

    Boolean. Defines if module should manage client_service

  • server_service_name (String) (defaults to: $nfs::params::server_service_name)

    String. It defines the servicename of the nfs server service

  • server_service_ensure (Enum['present', 'absent', 'running', 'stopped', 'disabled']) (defaults to: 'running')

    Boolean. It defines the service parameter ensure for nfs server services.

  • server_service_enable (Boolean) (defaults to: true)

    Boolean. It defines the service parameter enable for nfs server service.

  • server_service_hasrestart (Boolean) (defaults to: $nfs::params::server_service_hasrestart)

    Boolean. It defines the service parameter hasrestart for nfs server service.

  • server_service_hasstatus (Boolean) (defaults to: $nfs::params::server_service_hasstatus)

    Boolean. It defines the service parameter hasstatus for nfs server service.

  • server_service_restart_cmd (Optional[String]) (defaults to: $nfs::params::server_service_restart_cmd)

    String. It defines the service parameter restart for nfs server service.

  • server_nfsv4_servicehelper (Optional[Array]) (defaults to: $nfs::params::server_nfsv4_servicehelper)

    Array. It defines the service helper like idmapd for servers configured with nfs version 4.

  • client_services (Hash) (defaults to: $nfs::params::client_services)

    Nested Hash. It defines the servicenames need to be started when acting as a nfs client

  • client_nfsv4_services (Hash) (defaults to: $nfs::params::client_nfsv4_services)

    Nested Hash. It defines the servicenames need to be started when acting as a nfs client version 4.

  • client_services_enable (Boolean) (defaults to: $nfs::params::client_services_enable)

    Boolean. It defines the service parameter enable for nfs client services.

  • client_idmapd_setting (Array[String]) (defaults to: $nfs::params::client_idmapd_setting)

    Array. It defines the Augeas parameter added in @param defaults_file when acting as a nfs version 4 client.

  • client_nfs_fstype (String) (defaults to: $nfs::params::client_nfs_fstype)

    String. It defines the name of the nfs filesystem, when adding entries to /etc/fstab on a client node.

  • client_nfs_options (String) (defaults to: $nfs::params::client_nfs_options)

    String. It defines the options for the nfs filesystem, when adding entries to /etc/fstab on a client node.

  • client_nfsv4_fstype (String) (defaults to: $nfs::params::client_nfsv4_fstype)

    String. It defines the name of the nfs version 4 filesystem, when adding entries to /etc/fstab on a client node.

  • client_nfsv4_options (String) (defaults to: $nfs::params::client_nfsv4_options)

    String. It defines the options for the nfs version 4filesystem, when adding entries to /etc/fstab on a client node.

  • nfs_v4_export_root (String) (defaults to: '/export')

    String. It defines the location where nfs version 4 exports should be bindmounted to on a server node. Defaults to /export.

  • nfs_v4_export_root_clients (String) (defaults to: "*.${facts['networking']['domain']}(ro,fsid=root,insecure,no_subtree_check,async,root_squash)")

    String. It defines the clients that are allowed to mount nfs version 4 exports and includes the option string. Defaults to *.${::domain}(ro,fsid=root,insecure,no_subtree_check,async,root_squash).

  • nfs_v4_mount_root (String) (defaults to: '/srv')

    String. It defines the location where nfs version 4 clients find the mount root on a server node. Defaults to /srv.

  • nfs_v4_idmap_domain (String) (defaults to: $nfs::params::nfs_v4_idmap_domain)

    String. It defines the name of the idmapd domain setting in @param idmapd_file needed to be set to the same value on a server and client node to do correct uid and gid mapping. Defaults to $::domain.

  • nfsv4_bindmount_enable (Boolean) (defaults to: true)

    Boolean. It defines if the module should create a bindmount for the export. Defaults to true.

  • client_need_gssd (Boolean) (defaults to: false)

    Boolean. If true, sets NEED_GSSD=yes in /etc/defauls/nfs-common, usable on Debian/Ubuntu

  • client_gssd_service (Boolean) (defaults to: false)

    Boolean. If true enable rpc-gssd service.

  • client_gssd_options (String) (defaults to: $nfs::params::client_gssd_options)

    String. Options for rpc-gssd service. Defaults to ''

  • client_d9_gssdopt_workaround (Boolean) (defaults to: false)

    Boolean. If enabled, workaround for passing gssd_options which is broken on Debian 9. Usable only on Debian 9

  • nfs_v4_idmap_localrealms (Variant[String, Array]) (defaults to: '')

    String or Array. ‘Local-Realms’ option for idmapd. Defaults to ''

  • nfs_v4_idmap_cache (Integer) (defaults to: 0)

    Integer. ‘Cache-Expiration’ option for idmapd. Defaults to 0 - unused.

  • manage_nfs_v4_idmap_nobody_mapping (Boolean) (defaults to: false)

    Boolean. Enable setting Nobody mapping in idmapd. Defaults to false.

  • nfs_v4_idmap_nobody_user (String) (defaults to: $nfs::params::nfs_v4_idmap_nobody_user)

    String. ‘Nobody-User’ option for idmapd. Defaults to nobody.

  • nfs_v4_idmap_nobody_group (String) (defaults to: $nfs::params::nfs_v4_idmap_nobody_group)

    String. ‘Nobody-Group’ option for idmapd. Defaults to nobody or nogroup.

  • client_rpcbind_config (Optional[Stdlib::Absolutepath]) (defaults to: $nfs::params::client_rpcbind_config)

    String. It defines the location of the file with the rpcbind config.

  • client_rpcbind_optname (Optional[String]) (defaults to: $nfs::params::client_rpcbind_optname)

    String. It defines the name of env variable that holds the rpcbind config. E.g. OPTIONS for Debian

  • client_rpcbind_opts (Optional[String]) (defaults to: undef)

    String. Options for rpcbind service.

  • nfs_v4_root_export_ensure (String) (defaults to: 'mounted')

    String. It defines the state of the nfs version 4 root export. Defaults to mounted.

  • nfs_v4_root_export_mount (Optional[String]) (defaults to: undef)

    String. It defines the mountpoint of the nfs version 4 root export. Defaults to undef.

  • nfs_v4_root_export_remounts (Boolean) (defaults to: false)

    Boolean. It defines if the nfs version 4 root export should be remounted. Defaults to false.

  • nfs_v4_root_export_atboot (Boolean) (defaults to: false)

    Boolean. It defines if the nfs version 4 root export should be mounted at boot. Defaults to false.

  • nfs_v4_root_export_options (String) (defaults to: '_netdev')

    String. It defines the options for the nfs version 4 root export. Defaults to _netdev.

  • nfs_v4_root_export_bindmount (Optional[String]) (defaults to: undef)

    String. It defines the bindmount of the nfs version 4 root export. Defaults to undef.

  • nfs_v4_root_export_tag (Optional[String]) (defaults to: undef)

    String. It defines the tag of the nfs version 4 root export. Defaults to undef.

  • client_gssd_service_name (Optional[Hash]) (defaults to: $nfs::params::client_gssd_service_name)

    Hash. It defines the servicename of the rpc-gssd service.

  • client_services_hasrestart (Boolean) (defaults to: $nfs::params::client_services_hasrestart)

    Boolean. It defines the service parameter hasrestart for nfs client services.

  • client_services_hasstatus (Boolean) (defaults to: $nfs::params::client_services_hasstatus)

    Boolean. It defines the service parameter hasstatus for nfs client services.

  • client_gssdopt_name (String) (defaults to: $nfs::params::client_gssdopt_name)

    String. It defines the name of the gssd option in /etc/default/nfs-common.

Author:



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'manifests/init.pp', line 167

class nfs (
  Enum['present', 'absent', 'running', 'stopped', 'disabled'] $ensure                             = 'present',
  Boolean                                                     $server_enabled                     = false,
  Boolean                                                     $client_enabled                     = false,
  Boolean                                                     $storeconfigs_enabled               = true,
  Boolean                                                     $nfs_v4                             = false,
  Boolean                                                     $nfs_v4_client                      = false,
  Stdlib::Absolutepath                                        $exports_file                       = $nfs::params::exports_file,
  Stdlib::Absolutepath                                        $idmapd_file                        = $nfs::params::idmapd_file,
  Optional[Stdlib::Absolutepath]                              $defaults_file                      = $nfs::params::defaults_file,
  Boolean                                                     $manage_packages                    = true,
  Array                                                       $server_packages                    = $nfs::params::server_packages,
  String                                                      $server_package_ensure              = 'installed',
  Array                                                       $client_packages                    = $nfs::params::client_packages,
  String                                                      $client_package_ensure              = 'installed',
  Boolean                                                     $manage_server_service              = true,
  Boolean                                                     $manage_server_servicehelper        = true,
  Boolean                                                     $manage_client_service              = true,
  String                                                      $server_service_name                = $nfs::params::server_service_name,
  Enum['present', 'absent', 'running', 'stopped', 'disabled'] $server_service_ensure              = 'running',
  Boolean                                                     $server_service_enable              = true,
  Boolean                                                     $server_service_hasrestart          = $nfs::params::server_service_hasrestart,
  Boolean                                                     $server_service_hasstatus           = $nfs::params::server_service_hasstatus,
  Optional[String]                                            $server_service_restart_cmd         = $nfs::params::server_service_restart_cmd,
  Optional[Array]                                             $server_nfsv4_servicehelper         = $nfs::params::server_nfsv4_servicehelper,
  Hash                                                        $client_services                    = $nfs::params::client_services,
  Hash                                                        $client_nfsv4_services              = $nfs::params::client_nfsv4_services,
  Boolean                                                     $client_services_enable             = $nfs::params::client_services_enable,
  Boolean                                                     $client_services_hasrestart         = $nfs::params::client_services_hasrestart,
  Boolean                                                     $client_services_hasstatus          = $nfs::params::client_services_hasstatus,
  Array[String]                                               $client_idmapd_setting              = $nfs::params::client_idmapd_setting,
  String                                                      $client_nfs_fstype                  = $nfs::params::client_nfs_fstype,
  String                                                      $client_nfs_options                 = $nfs::params::client_nfs_options,
  String                                                      $client_nfsv4_fstype                = $nfs::params::client_nfsv4_fstype,
  String                                                      $client_nfsv4_options               = $nfs::params::client_nfsv4_options,
  Boolean                                                     $client_need_gssd                   = false,
  Boolean                                                     $client_gssd_service                = false,
  Optional[Hash]                                              $client_gssd_service_name           = $nfs::params::client_gssd_service_name,
  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                 = '/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,
  Boolean                                                     $manage_nfs_v4_idmap_nobody_mapping = false,
  String                                                      $nfs_v4_idmap_nobody_user           = $nfs::params::nfs_v4_idmap_nobody_user,
  String                                                      $nfs_v4_idmap_nobody_group          = $nfs::params::nfs_v4_idmap_nobody_group,
  String                                                      $nfs_v4_root_export_ensure          = 'mounted',
  Optional[String]                                            $nfs_v4_root_export_mount           = undef,
  Boolean                                                     $nfs_v4_root_export_remounts        = false,
  Boolean                                                     $nfs_v4_root_export_atboot          = false,
  String                                                      $nfs_v4_root_export_options         = '_netdev',
  Optional[String]                                            $nfs_v4_root_export_bindmount       = undef,
  Optional[String]                                            $nfs_v4_root_export_tag             = undef,
  Boolean                                                     $nfsv4_bindmount_enable             = true,
  Optional[Stdlib::Absolutepath]                              $client_rpcbind_config              = $nfs::params::client_rpcbind_config,
  Optional[String]                                            $client_rpcbind_optname             = $nfs::params::client_rpcbind_optname,
  Optional[String]                                            $client_rpcbind_opts                = undef,
) inherits nfs::params {
  if $server_enabled {
    if $server_nfsv4_servicehelper != undef {
      $effective_nfsv4_client_services = delete($client_nfsv4_services, $server_nfsv4_servicehelper)
    } else {
      $effective_nfsv4_client_services = $client_nfsv4_services
    }

    $effective_client_services = $client_services
    $effective_client_packages = difference($client_packages, $server_packages)
  } else {
    if $client_gssd_service and $client_gssd_service_name != undef {
      $effective_nfsv4_client_services = $client_nfsv4_services + $client_gssd_service_name
    } else {
      $effective_nfsv4_client_services = $client_nfsv4_services
    }

    $effective_client_services = $client_services
    $effective_client_packages = $client_packages
  }

  if $server_enabled {
    class { 'nfs::server': }
  }

  if $client_enabled {
    class { 'nfs::client': }
  }
}