Skip to content

Latest commit

 

History

History
1404 lines (795 loc) · 39.8 KB

REFERENCE.md

File metadata and controls

1404 lines (795 loc) · 39.8 KB

Reference

Table of Contents

Classes

  • nfs: Class: nfs::init * {Please take a look at} [https://github.com/voxpupuli/puppet-nfs#examples] * Daniel Klockenkaemper <mailto:dk@marketing-
  • nfs::client: Class: nfs::client This class exists to 1. order the loading of classes 2. including all needed classes for nfs as a client * Daniel Kloc
  • nfs::client::config: Class: nfs::client::config This Function exists to 1. configure nfs as a client * Daniel Klockenkaemper mailto:[email protected] *
  • nfs::client::package: Class: nfs::client::package This Function exists to 1. install needed packages for nfs clients * Daniel Klockenkaemper <mailto:dk@marketin
  • nfs::client::service: Class: nfs::client::service This Function exists to 1. manage the needed services for nfs clients * Daniel Klockenkaemper <mailto:dk@marke
  • nfs::params: Class: nfs::params This class exists to 1. Declutter the default value assignment for class parameters. 2. Manage internally used module var
  • nfs::server: Class: nfs::server
  • nfs::server::config: Class: nfs::server::config This class exists to 1. configure nfs as a server * Daniel Klockenkaemper mailto:[email protected] * Ma
  • nfs::server::package: Class: nfs::server::package This Function exists to 1. install needed packages for nfs server * Daniel Klockenkaemper <mailto:dk@marketing
  • nfs::server::service: Class: nfs::server::service This Function exists to 1. manage the needed services for nfs server * Daniel Klockenkaemper <mailto:dk@market

Defined types

  • nfs::client::mount: Function: nfs::client::mount This Function exists to 1. manage all mounts on a nfs client Parameters param nfs_v4 Boolean. When set to
  • nfs::functions::bindmount: Function: nfs::functions::bindmount This Function exists to 1. manage bindmounts * Daniel Klockenkaemper mailto:[email protected]
  • nfs::functions::create_export: Function: nfs::functions::create_export This Function exists to 1. manage export creation * Daniel Klockenkaemper <mailto:dk@marketing-fac
  • nfs::functions::mkdir: Function: nfs::functions::mkdir This Function exists to 1. manage dir creation * Daniel Klockenkaemper mailto:[email protected] *
  • nfs::functions::nfsv4_bindmount: Function: nfs::functions::nfsv4_bindmount This Function exists to 1. manage bindmounts for nfs4 * Daniel Klockenkaemper <mailto:dk@marketi
  • nfs::server::export: Function: nfs::server::export This Function exists to 1. manage all exported resources on a nfs server Parameters class { '::nfs': serv

Classes

nfs

Class: nfs::init

Parameters

The following parameters are available in the nfs class:

ensure

Data type: Enum['present', 'absent', 'running', 'stopped', 'disabled']

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.

Default value: 'present'

server_enabled

Data type: Boolean

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

Default value: false

client_enabled

Data type: Boolean

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.

Default value: false

storeconfigs_enabled

Data type: Boolean

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

Default value: true

nfs_v4

Data type: Boolean

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

Default value: false

nfs_v4_client

Data type: Boolean

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

Default value: false

exports_file

Data type: Stdlib::Absolutepath

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

Default value: $nfs::params::exports_file

idmapd_file

Data type: Stdlib::Absolutepath

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

Default value: $nfs::params::idmapd_file

defaults_file

Data type: Optional[Stdlib::Absolutepath]

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

Default value: $nfs::params::defaults_file

manage_packages

Data type: Boolean

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

Default value: true

server_packages

Data type: Array

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

Default value: $nfs::params::server_packages

server_package_ensure

Data type: String

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

Default value: 'installed'

client_packages

Data type: Array

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

Default value: $nfs::params::client_packages

client_package_ensure

Data type: String

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

Default value: 'installed'

manage_server_service

Data type: Boolean

Boolean. Defines if module should manage server_service

Default value: true

manage_server_servicehelper

Data type: Boolean

Boolean. Defines if module should manage server_servicehelper

Default value: true

manage_client_service

Data type: Boolean

Boolean. Defines if module should manage client_service

Default value: true

server_service_name

Data type: String

String. It defines the servicename of the nfs server service

Default value: $nfs::params::server_service_name

server_service_ensure

Data type: Enum['present', 'absent', 'running', 'stopped', 'disabled']

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

Default value: 'running'

server_service_enable

Data type: Boolean

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

Default value: true

server_service_hasrestart

Data type: Boolean

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

Default value: $nfs::params::server_service_hasrestart

server_service_hasstatus

Data type: Boolean

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

Default value: $nfs::params::server_service_hasstatus

server_service_restart_cmd

Data type: Optional[String]

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

Default value: $nfs::params::server_service_restart_cmd

server_nfsv4_servicehelper

Data type: Optional[Array]

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

Default value: $nfs::params::server_nfsv4_servicehelper

client_services

Data type: Hash

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

Default value: $nfs::params::client_services

client_nfsv4_services

Data type: Hash

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

Default value: $nfs::params::client_nfsv4_services

client_services_enable

Data type: Boolean

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

Default value: $nfs::params::client_services_enable

client_idmapd_setting

Data type: Array[String]

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

Default value: $nfs::params::client_idmapd_setting

client_nfs_fstype

Data type: String

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

Default value: $nfs::params::client_nfs_fstype

client_nfs_options

Data type: String

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

Default value: $nfs::params::client_nfs_options

client_nfsv4_fstype

Data type: String

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

Default value: $nfs::params::client_nfsv4_fstype

client_nfsv4_options

Data type: String

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

Default value: $nfs::params::client_nfsv4_options

nfs_v4_export_root

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: '/export'

nfs_v4_export_root_clients

Data type: String

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).

Default value: "*.${facts['networking']['domain']}(ro,fsid=root,insecure,no_subtree_check,async,root_squash)"

nfs_v4_mount_root

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: '/srv'

nfs_v4_idmap_domain

Data type: String

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.

Default value: $nfs::params::nfs_v4_idmap_domain

nfsv4_bindmount_enable

Data type: Boolean

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

Default value: true

client_need_gssd

Data type: Boolean

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

Default value: false

client_gssd_service

Data type: Boolean

Boolean. If true enable rpc-gssd service.

Default value: false

client_gssd_options

Data type: String

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

Default value: $nfs::params::client_gssd_options

client_d9_gssdopt_workaround

Data type: Boolean

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

Default value: false

nfs_v4_idmap_localrealms

Data type: Variant[String, Array]

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

Default value: ''

nfs_v4_idmap_cache

Data type: Integer

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

Default value: 0

manage_nfs_v4_idmap_nobody_mapping

Data type: Boolean

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

Default value: false

nfs_v4_idmap_nobody_user

Data type: String

String. 'Nobody-User' option for idmapd. Defaults to nobody.

Default value: $nfs::params::nfs_v4_idmap_nobody_user

nfs_v4_idmap_nobody_group

Data type: String

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

Default value: $nfs::params::nfs_v4_idmap_nobody_group

client_rpcbind_config

Data type: Optional[Stdlib::Absolutepath]

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

Default value: $nfs::params::client_rpcbind_config

client_rpcbind_optname

Data type: Optional[String]

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

Default value: $nfs::params::client_rpcbind_optname

client_rpcbind_opts

Data type: Optional[String]

String. Options for rpcbind service.

Default value: undef

nfs_v4_root_export_ensure

Data type: String

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

Default value: 'mounted'

nfs_v4_root_export_mount

Data type: Optional[String]

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

Default value: undef

nfs_v4_root_export_remounts

Data type: Boolean

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

Default value: false

nfs_v4_root_export_atboot

Data type: Boolean

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

Default value: false

nfs_v4_root_export_options

Data type: String

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

Default value: '_netdev'

nfs_v4_root_export_bindmount

Data type: Optional[String]

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

Default value: undef

nfs_v4_root_export_tag

Data type: Optional[String]

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

Default value: undef

client_gssd_service_name

Data type: Optional[Hash]

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

Default value: $nfs::params::client_gssd_service_name

client_services_hasrestart

Data type: Boolean

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

Default value: $nfs::params::client_services_hasrestart

client_services_hasstatus

Data type: Boolean

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

Default value: $nfs::params::client_services_hasstatus

client_gssdopt_name

Data type: String

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

Default value: $nfs::params::client_gssdopt_name

nfs::client

Class: nfs::client

This class exists to

  1. order the loading of classes
  2. including all needed classes for nfs as a client

Parameters

The following parameters are available in the nfs::client class:

ensure

Data type: String

The ensure parameter is used to determine if the nfs client should be configured and running or not. Valid values are 'present' and 'absent'. Default is 'present'.

Default value: $nfs::ensure

nfs_v4

Data type: Boolean

The nfs_v4 parameter is used to determine if the nfs client should use nfs version 4. Valid values are 'true' and 'false'. Default is 'false'.

Default value: $nfs::nfs_v4_client

nfs_v4_mount_root

Data type: String

The nfs_v4_mount_root parameter is used to determine the root directory for nfs version 4 mounts. Default is '/mnt'.

Default value: $nfs::nfs_v4_mount_root

nfs_v4_idmap_domain

Data type: String

The nfs_v4_idmap_domain parameter is used to determine the domain for nfs version 4 id mapping. Default is 'localdomain'.

Default value: $nfs::nfs_v4_idmap_domain

nfs::client::config

Class: nfs::client::config This Function exists to

  1. configure nfs as a client

nfs::client::package

Class: nfs::client::package

This Function exists to

  1. install needed packages for nfs clients

nfs::client::service

Class: nfs::client::service

This Function exists to

  1. manage the needed services for nfs clients

nfs::params

Class: nfs::params

This class exists to

  1. Declutter the default value assignment for class parameters.
  2. Manage internally used module variables in a central place.

Therefore, many operating system dependent differences (names, paths, ...) are addressed in here.

nfs::server

This class exists to

  1. order the loading of classes
  2. including all needed classes for nfs as a server

Parameters

The following parameters are available in the nfs::server class:

ensure

Data type: Enum['present', 'absent', 'running', 'stopped', 'disabled']

Default value: $nfs::ensure

nfs_v4

Data type: Boolean

Default value: $nfs::nfs_v4

nfs_v4_export_root

Data type: String

Default value: $nfs::nfs_v4_export_root

nfs_v4_export_root_clients

Data type: String

Default value: $nfs::nfs_v4_export_root_clients

nfs_v4_idmap_domain

Data type: String

Default value: $nfs::nfs_v4_idmap_domain

nfs_v4_root_export_ensure

Data type: String

Default value: $nfs::nfs_v4_root_export_ensure

nfs_v4_root_export_mount

Data type: Optional[String]

Default value: $nfs::nfs_v4_root_export_mount

nfs_v4_root_export_remounts

Data type: Boolean

Default value: $nfs::nfs_v4_root_export_remounts

nfs_v4_root_export_atboot

Data type: Boolean

Default value: $nfs::nfs_v4_root_export_atboot

nfs_v4_root_export_options

Data type: String

Default value: $nfs::nfs_v4_root_export_options

nfs_v4_root_export_bindmount

Data type: Optional[String]

Default value: $nfs::nfs_v4_root_export_bindmount

nfs_v4_root_export_tag

Data type: Optional[String]

Default value: $nfs::nfs_v4_root_export_tag

nfs::server::config

Class: nfs::server::config

This class exists to

  1. configure nfs as a server

nfs::server::package

Class: nfs::server::package

This Function exists to

  1. install needed packages for nfs server

nfs::server::service

Class: nfs::server::service

This Function exists to

  1. manage the needed services for nfs server

Defined types

nfs::client::mount

Function: nfs::client::mount

This Function exists to

  1. manage all mounts on a nfs client

Parameters

param nfs_v4 Boolean. When set to true, it uses nfs version 4 to mount a share.

class { '::nfs': client_enabled => true, nfs_v4_client => true }

nfs::client::mount { '/target/directory': server => '1.2.3.4', share => 'share_name_on_nfs_server', remounts => true, atboot => true, options_nfsv4 => 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3' }

Parameters

The following parameters are available in the nfs::client::mount defined type:

server

Data type: String[1]

String. Sets the ip address of the server with the nfs export

share

Data type: Optional[String[1]]

String. Sets the name of the nfs share on the server

Default value: undef

ensure

Data type: String[1]

String. Sets the ensure parameter of the mount.

Default value: 'mounted'

remounts

Data type: Boolean

String. Sets the remounts parameter of the mount.

Default value: false

atboot

Data type: Boolean

String. Sets the atboot parameter of the mount.

Default value: false

options_nfsv4

Data type: String[1]

String. Sets the mount options for a nfs version 4 mount.

Default value: $nfs::client_nfsv4_options

options_nfs

Data type: String[1]

String. Sets the mount options for a nfs mount.

Default value: $nfs::client_nfs_options

bindmount

Data type: Optional[String[1]]

String. When not undef it will create a bindmount on the node for the nfs mount.

Default value: undef

nfstag

Data type: Optional[String[1]]

String. Sets the nfstag parameter of the mount.

Default value: undef

owner

Data type: Optional[String[1]]

String. Set owner of mount dir

Default value: undef

group

Data type: Optional[String[1]]

String. Set group of mount dir

Default value: undef

mode

Data type: Optional[String[1]]

String. Set mode of mount dir

Default value: undef

mount_root

Data type: Optional[String[1]]

String. Overwrite mount root if differs from server config

Default value: undef

mount

Data type: String[1]

Default value: $title

manage_packages

Data type: Boolean

Default value: $nfs::manage_packages

client_packages

Data type: Optional[Variant[String[1], Array[String[1]]]]

Default value: $nfs::effective_client_packages

nfs_v4

Data type: Boolean

Default value: $nfs::client::nfs_v4

nfs::functions::bindmount

Function: nfs::functions::bindmount

This Function exists to

  1. manage bindmounts

Parameters

The following parameters are available in the nfs::functions::bindmount defined type:

mount_name

Data type: Optional[String[1]]

String. Sets the target directory for the bindmount

Default value: undef

ensure

Data type: String[1]

String. Sets if enabled or not.

Default value: 'present'

nfs::functions::create_export

Function: nfs::functions::create_export

This Function exists to

  1. manage export creation

Parameters

The following parameters are available in the nfs::functions::create_export defined type:

clients

Data type: Variant[String[1], Array[String[1]]]

String or Array. Sets the clients allowed to mount the export with options.

ensure

Data type: String[1]

String. Sets if enabled or not.

Default value: 'present'

owner

Data type: Optional[String[1]]

String. Sets the owner of the exported directory.

Default value: undef

group

Data type: Optional[String[1]]

String. Sets the group of the exported directory.

Default value: undef

mode

Data type: Optional[String[1]]

String. Sets the permissions of the exported directory.

Default value: undef

nfs::functions::mkdir

Function: nfs::functions::mkdir

This Function exists to

  1. manage dir creation

Parameters

The following parameters are available in the nfs::functions::mkdir defined type:

ensure

Data type: String[1]

Default value: 'present'

nfs::functions::nfsv4_bindmount

Function: nfs::functions::nfsv4_bindmount

This Function exists to

  1. manage bindmounts for nfs4

Parameters

The following parameters are available in the nfs::functions::nfsv4_bindmount defined type:

v4_export_name

Data type: String[1]

String. Sets the target directory for the bindmount

bind

Data type: String[1]

String. Sets the bindmount options.

ensure

Data type: String[1]

String. Sets if mounted or not.

Default value: 'mounted'

nfs::server::export

Function: nfs::server::export

This Function exists to

  1. manage all exported resources on a nfs server

Parameters

class { '::nfs': server_enabled => true, nfs_v4 => true, nfs_v4_export_root => '/share', nfs_v4_export_root_clients => '1.2.3.4/24(rw,fsid=root,insecure,no_subtree_check,async,no_root_squash)', }

nfs::server::export { '/srv/nfs_exported/directory': clients => '1.2.3.4/24(rw,insecure,no_subtree_check,async,no_root_squash) 5.6.7.8/24(ro)', share => 'share_name_on_nfs_server', }

Links

Parameters

The following parameters are available in the nfs::server::export defined type:

clients

Data type: String[1]

String or Array. Sets the allowed clients and options for the export in the exports file. Defaults to localhost(ro)

Default value: 'localhost(ro)'

bind

Data type: String[1]

String. Sets the bind options setted in /etc/fstab for the bindmounts created. Defaults to rbind

Default value: 'rbind'

ensure

Data type: String[1]

String. If enabled the mount will be created. Defaults to mounted

Default value: 'mounted'

remounts

Data type: Boolean

String. Sets the remounts parameter of the mount.

Default value: false

atboot

Data type: Boolean

String. Sets the atboot parameter of the mount.

Default value: false

options_nfsv4

Data type: String[1]

String. Sets the mount options for a nfs version 4 exported resource mount.

Default value: $nfs::client_nfsv4_options

options_nfs

Data type: String[1]

String. Sets the mount options for a nfs exported resource mount.

Default value: $nfs::client_nfs_options

bindmount

Data type: Optional[String[1]]

String. When not undef it will create a bindmount on the node for the nfs mount.

Default value: undef

nfstag

Data type: Optional[String[1]]

String. Sets the nfstag parameter of the mount.

Default value: undef

mount

Data type: Optional[String[1]]

String. Sets the mountpoint the client will mount the exported resource mount on. If undef it defaults to the same path as on the server

Default value: undef

owner

Data type: Optional[String[1]]

String. Sets the owner of the exported directory

Default value: undef

group

Data type: Optional[String[1]]

String. Sets the group of the exported directory

Default value: undef

mode

Data type: Optional[String[1]]

String. Sets the permissions of the exported directory.

Default value: undef

server

Data type: String[1]

String. Sets the hostname clients will use to mount the exported resource. If undef it defaults to the trusted certname

Default value: $facts['clientcert']

v3_export_name

Data type: String[1]

Default value: $name

v4_export_name

Data type: String[1]

Default value: regsubst($name, '.*/(.*)', '\1' )

nfsv4_bindmount_enable

Data type: Boolean

Default value: $nfs::nfsv4_bindmount_enable