Skip to content

Latest commit

 

History

History
1284 lines (705 loc) · 34.2 KB

REFERENCE.md

File metadata and controls

1284 lines (705 loc) · 34.2 KB

Reference

Table of Contents

Classes

Defined types

Classes

nfs

The nfs class.

Parameters

The following parameters are available in the nfs class:

ensure

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

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

Default value: 'present'

server_enabled

Data type: 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

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

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

Default value: true

nfs_v4

Data type: 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

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.

Default value: false

exports_file

Data type: Stdlib::Absolutepath

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

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

Default value: $nfs::params::idmapd_file

defaults_file

Data type: Optional[Stdlib::Absolutepath]

It defines the location of the file with the NFS settings.

Default value: $nfs::params::defaults_file

manage_packages

Data type: Boolean

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

Default value: true

server_packages

Data type: 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

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

Default value: 'installed'

client_packages

Data type: 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

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

Default value: 'installed'

manage_server_service

Data type: Boolean

Defines if module should manage server_service.

Default value: true

manage_server_servicehelper

Data type: Boolean

Defines if module should manage server_servicehelper.

Default value: true

manage_client_service

Data type: Boolean

Defines if module should manage client_service.

Default value: true

server_service_name

Data type: 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']

It defines the service parameter ensure for NFS server services.

Default value: 'running'

server_service_enable

Data type: Boolean

It defines the service parameter enable for NFS server service.

Default value: true

server_service_hasrestart

Data type: Boolean

It defines the service parameter hasrestart for NFS server service.

Default value: $nfs::params::server_service_hasrestart

server_service_hasstatus

Data type: 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]

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]

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

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

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

It defines the service parameter enable for NFS client services.

Default value: $nfs::params::client_services_enable

client_idmapd_setting

Data type: Array[String]

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

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

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

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

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

Default value: $nfs::params::client_nfsv4_options

nfs_v4_export_root

Data type: String

It defines the location where NFS version 4 exports should be bindmounted to on a server node.

Default value: '/export'

nfs_v4_export_root_clients

Data type: String

It defines the clients that are allowed to mount NFS version 4 exports and includes the option string.

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

nfs_v4_mount_root

Data type: String

It defines the location where NFS version 4 clients find the mount root on a server node.

Default value: '/srv'

nfs_v4_idmap_domain

Data type: 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.

Default value: $nfs::params::nfs_v4_idmap_domain

nfsv4_bindmount_enable

Data type: Boolean

It defines if the module should create a bindmount for the export.

Default value: true

client_need_gssd

Data type: 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

If true enable rpc-gssd service.

Default value: false

client_gssd_options

Data type: String

Options for rpc-gssd service.

Default value: $nfs::params::client_gssd_options

client_d9_gssdopt_workaround

Data type: 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]

Local-Realms option for idmapd.

Default value: ''

nfs_v4_idmap_cache

Data type: Integer

Cache-Expiration option for idmapd. If 0 cache is unused.

Default value: 0

manage_nfs_v4_idmap_nobody_mapping

Data type: Boolean

Enable setting Nobody mapping in idmapd.

Default value: false

nfs_v4_idmap_nobody_user

Data type: String

Nobody-User option for idmapd.

Default value: $nfs::params::nfs_v4_idmap_nobody_user

nfs_v4_idmap_nobody_group

Data type: String

Nobody-Group option for idmapd.

Default value: $nfs::params::nfs_v4_idmap_nobody_group

client_rpcbind_config

Data type: Optional[Stdlib::Absolutepath]

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]

It defines the name of environment 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]

Options for rpcbind service.

Default value: undef

nfs_v4_root_export_ensure

Data type: String

It defines the state of the NFS version 4 root export.

Default value: 'mounted'

nfs_v4_root_export_mount

Data type: Optional[String]

It defines the mountpoint of the NFS version 4 root export.

Default value: undef

nfs_v4_root_export_remounts

Data type: Boolean

It defines if the NFS version 4 root export should be remounted.

Default value: false

nfs_v4_root_export_atboot

Data type: Boolean

It defines if the NFS version 4 root export should be mounted at boot.

Default value: false

nfs_v4_root_export_options

Data type: String

It defines the options for the NFS version 4 root export.

Default value: '_netdev'

nfs_v4_root_export_bindmount

Data type: Optional[String]

It defines the bindmount of the NFS version 4 root export.

Default value: undef

nfs_v4_root_export_tag

Data type: Optional[String]

It defines the tag of the NFS version 4 root export.

Default value: undef

client_gssd_service_name

Data type: Optional[Hash]

It defines the servicename of the rpc-gssd service.

Default value: $nfs::params::client_gssd_service_name

client_services_hasrestart

Data type: Boolean

It defines the service parameter hasrestart for NFS client services.

Default value: $nfs::params::client_services_hasrestart

client_services_hasstatus

Data type: Boolean

It defines the service parameter hasstatus for NFS client services.

Default value: $nfs::params::client_services_hasstatus

client_gssdopt_name

Data type: String

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

Default value: $nfs::params::client_gssdopt_name

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.

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.

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 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 value: $nfs::nfs_v4_idmap_domain

nfs::client::config

Configure NFS as a client.

nfs::client::package

Install needed packages for NFS clients.

nfs::client::service

Manage the needed services for NFS clients.

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

Configure NFS as a server.

nfs::server::package

Install needed packages for NFS server.

nfs::server::service

Manage the needed services for NFS server.

Defined types

nfs::client::mount

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

Examples

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]

Sets the ip address of the server with the NFS export.

share

Data type: Optional[String[1]]

Sets the name of the NFS share on the server.

Default value: undef

ensure

Data type: String[1]

Sets the ensure parameter of the mount.

Default value: 'mounted'

remounts

Data type: Boolean

Sets the remounts parameter of the mount.

Default value: false

atboot

Data type: Boolean

Sets the atboot parameter of the mount.

Default value: false

options_nfsv4

Data type: String[1]

Sets the mount options for a NFS version 4 mount.

Default value: $nfs::client_nfsv4_options

options_nfs

Data type: String[1]

Sets the mount options for a NFS mount.

Default value: $nfs::client_nfs_options

bindmount

Data type: Optional[String[1]]

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

Default value: undef

nfstag

Data type: Optional[String[1]]

Sets the nfstag parameter of the mount.

Default value: undef

owner

Data type: Optional[String[1]]

Set owner of mount directory.

Default value: undef

group

Data type: Optional[String[1]]

Set group of mount directory.

Default value: undef

mode

Data type: Optional[String[1]]

Set mode of mount directory.

Default value: undef

mount_root

Data type: Optional[String[1]]

Overwrite mount root if differs from server configuration.

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

Manage bindmounts.

Parameters

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

mount_name

Data type: Optional[String[1]]

Sets the target directory for the bindmount.

Default value: undef

ensure

Data type: String[1]

Sets if enabled or not.

Default value: 'present'

nfs::functions::create_export

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]]]

Sets the clients allowed to mount the export with options.

ensure

Data type: String[1]

Sets if enabled or not.

Default value: 'present'

owner

Data type: Optional[String[1]]

Sets the owner of the exported directory.

Default value: undef

group

Data type: Optional[String[1]]

Sets the group of the exported directory.

Default value: undef

mode

Data type: Optional[String[1]]

Sets the permissions of the exported directory.

Default value: undef

nfs::functions::mkdir

Manage directory 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

Manage bindmounts for NFS v4.

Parameters

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

v4_export_name

Data type: String[1]

Sets the target directory for the bindmount.

bind

Data type: String[1]

Sets the bindmount options.

ensure

Data type: String[1]

Sets if mounted or not.

Default value: 'mounted'

nfs::server::export

Manage all exported resources on a NFS server.

Examples

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',
}

Parameters

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

clients

Data type: String[1]

Sets the allowed clients and options for the export in the exports file.

Default value: 'localhost(ro)'

bind

Data type: String[1]

Sets the bind options setted in /etc/fstab for the bindmounts created.

Default value: 'rbind'

ensure

Data type: String[1]

If enabled the mount will be created.

Default value: 'mounted'

remounts

Data type: Boolean

Sets the remounts parameter of the mount.

Default value: false

atboot

Data type: Boolean

Sets the atboot parameter of the mount.

Default value: false

options_nfsv4

Data type: String[1]

Sets the mount options for a NFS version 4 exported resource mount.

Default value: $nfs::client_nfsv4_options

options_nfs

Data type: String[1]

Sets the mount options for a NFS exported resource mount.

Default value: $nfs::client_nfs_options

bindmount

Data type: Optional[String[1]]

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

Default value: undef

nfstag

Data type: Optional[String[1]]

Sets the nfstag parameter of the mount.

Default value: undef

mount

Data type: Optional[String[1]]

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]]

Sets the owner of the exported directory.

Default value: undef

group

Data type: Optional[String[1]]

Sets the group of the exported directory.

Default value: undef

mode

Data type: Optional[String[1]]

Sets the permissions of the exported directory.

Default value: undef

server

Data type: String[1]

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