diff --git a/.fixtures.yml b/.fixtures.yml index 73c6493f..a18692c3 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -4,12 +4,8 @@ fixtures: concat: "https://github.com/puppetlabs/puppetlabs-concat.git" augeasproviders_core: "https://github.com/voxpupuli/puppet-augeasproviders_core.git" augeasproviders_shellvar: "https://github.com/voxpupuli/puppet-augeasproviders_shellvar.git" - augeas_core: - repo: "https://github.com/puppetlabs/puppetlabs-augeas_core.git" - puppet_version: ">= 6.0.0" - mount_core: - repo: "https://github.com/puppetlabs/puppetlabs-mount_core.git" - puppet_version: ">= 6.0.0" + augeas_core: "https://github.com/puppetlabs/puppetlabs-augeas_core.git" + mount_core: "https://github.com/puppetlabs/puppetlabs-mount_core.git" transition: "https://github.com/puppetlabs/puppetlabs-transition.git" symlinks: "nfs": "#{source_dir}" diff --git a/.github/workflows/test-suite.yaml b/.github/workflows/test-suite.yaml deleted file mode 100644 index 0dec901b..00000000 --- a/.github/workflows/test-suite.yaml +++ /dev/null @@ -1,127 +0,0 @@ -name: Test suite - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test-static-current: - strategy: - fail-fast: false - matrix: - puppet: [7.22.0] - ruby: [2.7.7, 3.0.5, 3.1.3] - - name: Static code analysis - runs-on: ubuntu-20.04 - permissions: - contents: read - - steps: - - uses: actions/checkout@v3 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - env: - PUPPET_VERSION: ${{ matrix.puppet }} - - - name: Run metadata lint - run: | - PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake metadata_lint - - - name: Run puppet lint - run: | - PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake lint - - - name: Run puppet syntax check - run: | - PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake syntax - - - name: Run puppet rspec tests - run: | - PUPPET_VERSION=${{ matrix.puppet }} STRICT_VARIABLES=yes bundle exec rake spec - - - name: Run rubocop tests - run: | - PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake rubocop - - test-static-old: - strategy: - fail-fast: false - matrix: - puppet: [5.5.22, 6.29.0] - ruby: [2.5.9, 2.6.9] - - name: Static code analysis - runs-on: ubuntu-20.04 - permissions: - contents: read - - steps: - - uses: actions/checkout@v3 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - env: - PUPPET_VERSION: ${{ matrix.puppet }} - - - name: Run metadata lint - run: | - PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake metadata_lint - - - name: Run puppet lint - run: | - PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake lint - - - name: Run puppet syntax check - run: | - PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake syntax - - - name: Run puppet rspec tests - run: | - PUPPET_VERSION=${{ matrix.puppet }} STRICT_VARIABLES=yes bundle exec rake spec - - - name: Run rubocop tests - run: | - PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake rubocop - - test-integration: - strategy: - fail-fast: false - matrix: - puppet: [puppet6, puppet7] - beakerset: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, centos-7, debian-10, debian-11] - - name: Integration tests - runs-on: ubuntu-20.04 - permissions: - contents: read - - steps: - - uses: actions/checkout@v2 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.6.9 - bundler-cache: true - env: - BEAKER_set: ${{ matrix.beakerset }} - BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet }} - PUPPET_INSTALL_TYPE: agent - - - name: Run puppet-beaker tests - run: | - BEAKER_destroy=yes bundle exec rake acceptance - env: - BEAKER_set: ${{ matrix.beakerset }} - BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet }} - PUPPET_INSTALL_TYPE: agent diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d38f9ba..d938b5d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,14 +49,14 @@ - ignore export root when bindmount is disabled - use BEAKER_PUPPET_COLLECTION in all beaker tests - do not include class by absolute name -- revert use of File without defined() +- revert use of File without defined() - update rvm to 2.4.1 for PUPPET_VERSION 4.10.0 ## 2019-02-12 - Release 2.1.2 ### Summary #### Features -- herculesteam-augeasprovides_shellvar has been updated to 3.0.0 +- herculesteam-augeasprovides_shellvar has been updated to 3.0.0 ## 2019-02-12 - Release 2.1.1 ### Summary @@ -130,7 +130,7 @@ - set $nfs_v4_idmap_domain to 'example.org' when $::domain is undef - add client service rpcbind.socket for RedHat 7 - set client service rpcbind.service for RedHat 7 to enable => false -- fix service parameters for Debian 7 +- fix service parameters for Debian 7 #### Features - update rubocop rules and fix ruby code style @@ -149,7 +149,7 @@ - add install locales on ubuntu-1604 docker for acceptance tests - add missing documentation for client_services_enable - reenable client_services_enable for CentOS/Redhat 7 -- remove rpc.idmapd from $client_nfsv4_services for Archlinux +- remove rpc.idmapd from $client_nfsv4_services for Archlinux - rename rpc.idmapd to nfs-idmapd in $server_nfsv4_servicehelper for archlinux - update adn fix spec tests diff --git a/README.md b/README.md index 8ee4b42a..be9d937b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,20 @@ # nfs +[![Build Status](https://github.com/voxpupuli/puppet-nfs/workflows/CI/badge.svg)](https://github.com/voxpupuli/puppet-nfs/actions?query=workflow%3ACI) +[![Code Coverage](https://coveralls.io/repos/github/voxpupuli/puppet-nfs/badge.svg?branch=master)](https://coveralls.io/github/voxpupuli/puppet-nfs) +[![Puppet Forge](https://img.shields.io/puppetforge/v/puppet/nfs.svg)](https://forge.puppetlabs.com/puppet/nfs) +[![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/puppet/nfs.svg)](https://forge.puppetlabs.com/puppet/nfs) +[![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/nfs.svg)](https://forge.puppetlabs.com/puppet/nfs) +[![Puppet Forge - scores](https://img.shields.io/puppetforge/f/puppet/nfs.svg)](https://forge.puppetlabs.com/puppet/nfs) + +This module was migrated from Daniel Klockenkaemper to Vox Pupuli. + #### Table of Contents 1. [Module Description - What the module does and why it is useful](#module-description) -2. [Setup - The basics of getting started with derdanne-nfs](#setup) - * [What derdanne-nfs affects](#what-derdanne-nfs-affects) +2. [Setup - The basics of getting started with puppet-nfs](#setup) + * [What puppet-nfs affects](#what-puppet-nfs-affects) * [Setup requirements](#setup-requirements) - * [Beginning with derdanne-nfs](#beginning-with-derdanne-nfs) + * [Beginning with puppet-nfs](#beginning-with-puppet-nfs) 3. [Usage - Configuration options and additional functionality](#usage) 4. [Reference - An under-the-hood peek at what the module is doing and how](#reference) 5. [Limitations - OS compatibility, etc.](#limitations) @@ -24,10 +33,10 @@ and 'client_enabled'. It also has some dependencies on newer stdlib functions li It supports the OS Families Ubuntu, Debian, Redhat, SUSE, Gentoo and Archlinux. It supports also Strict Variables, so if you pass all OS specific parameters correctly it should work on your preferred OS too. Feedback, bugreports, -and feature requests are always welcome, visit https://github.com/derdanne/puppet-nfs or send me an email. +and feature requests are always welcome, visit https://github.com/voxpupuli/puppet-nfs or send me an email. -When you are using a puppet version 3.x like it is shipped with Redhat Satellite 6, please use a version 1.x.x from puppet forge -or the branch puppet3 when cloning directly from Github. (Note: https://github.com/derdanne/puppet-nfs/pull/49#issuecomment-285091678). +When you are using a puppet version 3.x like it is shipped with Redhat Satellite 6, please use a version 1.x.x from puppet forge +or the branch puppet3 when cloning directly from Github. (Note: https://github.com/voxpupuli/puppet-nfs/pull/49#issuecomment-285091678). I'll recommend using puppet >= 4.6.1, puppet versions up until 4.6.0 had various issues. If you want to contribute, please do a fork on github, create a branch "feature name" with your @@ -40,18 +49,18 @@ Warning: I've introduced new dependencies with version 2.1.0 which were needed t ## Setup -### What derdanne-nfs affects +### What puppet-nfs affects -This module can be used to configure your nfs client and/or server, it could export -nfs mount resources via storeconfigs or simply mount nfs shares on a client. You can +This module can be used to configure your nfs client and/or server, it could export +nfs mount resources via storeconfigs or simply mount nfs shares on a client. You can also easily use the create_resources function when you store your exports i.e. via hiera. ### Setup requirements This Module depends on puppetlabs-stdlib >= 4.5.0 and puppetlabs-concat >= 1.1.2, you need to -have these modules installed to use derdanne-nfs module. +have these modules installed to use puppet-nfs module. -### Beginning with derdanne-nfs +### Beginning with puppet-nfs On a nfs server the following code is sufficient to get all packages installed and services running to use nfs: @@ -110,7 +119,7 @@ This will mount /data on client in /share/data. nfs_v4_client => true, nfs_v4_idmap_domain => $::domain, } - + nfs::client::mount { '/share/data': server => '192.168.0.1', share => 'data', @@ -368,26 +377,26 @@ This will mount /data on client in /share/data. **Puppet:** ```puppet - + node server { hiera_include('classes') $nfs_exports_global = hiera_hash('nfs::nfs_exports_global', false) - + $defaults_nfs_exports = { ensure => 'mounted', clients => '192.168.0.0/24(rw,insecure,no_subtree_check,async,no_root_squash)', nfstag => $::fqdn, } - + if $nfs_exports_global { create_resources('::nfs::server::export', $nfs_exports_global, $defaults_nfs_exports) } } - + node client { hiera_include('classes') $nfs_server = hiera('nfs::nfs_server', false) - + if $nfs_server { Nfs::Client::Mount <<| nfstag == $nfs_server |>> } @@ -611,7 +620,7 @@ This will mount /data on client in /share/data. String. 'Nobody-User' option for idmapd. Defaults to nobody. ##### `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. ##### `client_rpcbind_config` String. It defines the location of the file with the rpcbind config. @@ -681,10 +690,10 @@ This will mount /data on client in /share/data. ##### `bind` String. Sets the bind options setted in /etc/fstab for the bindmounts created. Defaults to rbind. When you have any submounts in your exported folders, - the rbind option will submount them in the bindmount folder. You have to set the + the rbind option will submount them in the bindmount folder. You have to set the  `crossmnt` option in your nfs export to have the submounts from rbind available on your client. Your export should look like this: - + ```puppet node client { nfs::server::export { '/home': @@ -692,7 +701,7 @@ node client { clients => '*(rw,insecure,no_subtree_check,async,no_root_squash,crossmnt)', } } -``` +``` ##### `ensure` String. If enabled the mount will be created. Defaults to mounted @@ -746,19 +755,19 @@ puppet > 3.2.0 augeas ## Limitations -If you want to have specific package versions installed you may manage the needed packages outside of this +If you want to have specific package versions installed you may manage the needed packages outside of this module (use manage_packages => false). It is only tested to use 'present', 'installed', 'absent', 'purged', 'held' and 'latest' as argument for the parameters server_package_ensure and client_package_ensure. ## Development Derdanne modules are open projects. So if you want to make this module even better, -you can contribute to this module on [Github](https://github.com/derdanne/puppet-nfs). +you can contribute to this module on [Github](https://github.com/voxpupuli/puppet-nfs). Before pushing PRs to Github i would recommend you to test your work locally. So you can ensure all test builds -on Travis CI were passing. I have prepared an easy way to test your code locally with the help of Docker. +on Travis CI were passing. I have prepared an easy way to test your code locally with the help of Docker. -For running the complete static code analysis, it is sufficient to run a `make test-all`. +For running the complete static code analysis, it is sufficient to run a `make test-all`. ### Default settings @@ -790,7 +799,7 @@ You can run the following commands to setup and run the testsuite on your local #### `make build` -Build a docker image with a Ruby version which is not available on Docker hub. Check out +Build a docker image with a Ruby version which is not available on Docker hub. Check out `https://hub.docker.com/r/derdanne/rvm/` to see if i have already prepared a rvm build for the ruby version you want to test. Take a look at the Dockerfile located in `spec/local-testing` if you want to customize your builds. diff --git a/REFERENCE.md b/REFERENCE.md new file mode 100644 index 00000000..ad547db0 --- /dev/null +++ b/REFERENCE.md @@ -0,0 +1,1404 @@ +# Reference + + + +## Table of Contents + +### Classes + +* [`nfs`](#nfs): Class: nfs::init * {Please take a look at} [https://github.com/voxpupuli/puppet-nfs#examples] * Daniel Klockenkaemper * +* [`nfs::client::package`](#nfs--client--package): Class: nfs::client::package This Function exists to 1. install needed packages for nfs clients * Daniel Klockenkaemper * Ma +* [`nfs::server::package`](#nfs--server--package): Class: nfs::server::package This Function exists to 1. install needed packages for nfs server * Daniel Klockenkaemper +* [`nfs::functions::create_export`](#nfs--functions--create_export): Function: nfs::functions::create_export This Function exists to 1. manage export creation * Daniel Klockenkaemper * +* [`nfs::functions::nfsv4_bindmount`](#nfs--functions--nfsv4_bindmount): Function: nfs::functions::nfsv4_bindmount This Function exists to 1. manage bindmounts for nfs4 * Daniel Klockenkaemper `nfs` + +Class: nfs::init + +* {Please take a look at} [https://github.com/voxpupuli/puppet-nfs#examples] + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs` class: + +* [`ensure`](#-nfs--ensure) +* [`server_enabled`](#-nfs--server_enabled) +* [`client_enabled`](#-nfs--client_enabled) +* [`storeconfigs_enabled`](#-nfs--storeconfigs_enabled) +* [`nfs_v4`](#-nfs--nfs_v4) +* [`nfs_v4_client`](#-nfs--nfs_v4_client) +* [`exports_file`](#-nfs--exports_file) +* [`idmapd_file`](#-nfs--idmapd_file) +* [`defaults_file`](#-nfs--defaults_file) +* [`manage_packages`](#-nfs--manage_packages) +* [`server_packages`](#-nfs--server_packages) +* [`server_package_ensure`](#-nfs--server_package_ensure) +* [`client_packages`](#-nfs--client_packages) +* [`client_package_ensure`](#-nfs--client_package_ensure) +* [`manage_server_service`](#-nfs--manage_server_service) +* [`manage_server_servicehelper`](#-nfs--manage_server_servicehelper) +* [`manage_client_service`](#-nfs--manage_client_service) +* [`server_service_name`](#-nfs--server_service_name) +* [`server_service_ensure`](#-nfs--server_service_ensure) +* [`server_service_enable`](#-nfs--server_service_enable) +* [`server_service_hasrestart`](#-nfs--server_service_hasrestart) +* [`server_service_hasstatus`](#-nfs--server_service_hasstatus) +* [`server_service_restart_cmd`](#-nfs--server_service_restart_cmd) +* [`server_nfsv4_servicehelper`](#-nfs--server_nfsv4_servicehelper) +* [`client_services`](#-nfs--client_services) +* [`client_nfsv4_services`](#-nfs--client_nfsv4_services) +* [`client_services_enable`](#-nfs--client_services_enable) +* [`client_idmapd_setting`](#-nfs--client_idmapd_setting) +* [`client_nfs_fstype`](#-nfs--client_nfs_fstype) +* [`client_nfs_options`](#-nfs--client_nfs_options) +* [`client_nfsv4_fstype`](#-nfs--client_nfsv4_fstype) +* [`client_nfsv4_options`](#-nfs--client_nfsv4_options) +* [`nfs_v4_export_root`](#-nfs--nfs_v4_export_root) +* [`nfs_v4_export_root_clients`](#-nfs--nfs_v4_export_root_clients) +* [`nfs_v4_mount_root`](#-nfs--nfs_v4_mount_root) +* [`nfs_v4_idmap_domain`](#-nfs--nfs_v4_idmap_domain) +* [`nfsv4_bindmount_enable`](#-nfs--nfsv4_bindmount_enable) +* [`client_need_gssd`](#-nfs--client_need_gssd) +* [`client_gssd_service`](#-nfs--client_gssd_service) +* [`client_gssd_options`](#-nfs--client_gssd_options) +* [`client_d9_gssdopt_workaround`](#-nfs--client_d9_gssdopt_workaround) +* [`nfs_v4_idmap_localrealms`](#-nfs--nfs_v4_idmap_localrealms) +* [`nfs_v4_idmap_cache`](#-nfs--nfs_v4_idmap_cache) +* [`manage_nfs_v4_idmap_nobody_mapping`](#-nfs--manage_nfs_v4_idmap_nobody_mapping) +* [`nfs_v4_idmap_nobody_user`](#-nfs--nfs_v4_idmap_nobody_user) +* [`nfs_v4_idmap_nobody_group`](#-nfs--nfs_v4_idmap_nobody_group) +* [`client_rpcbind_config`](#-nfs--client_rpcbind_config) +* [`client_rpcbind_optname`](#-nfs--client_rpcbind_optname) +* [`client_rpcbind_opts`](#-nfs--client_rpcbind_opts) +* [`nfs_v4_root_export_ensure`](#-nfs--nfs_v4_root_export_ensure) +* [`nfs_v4_root_export_mount`](#-nfs--nfs_v4_root_export_mount) +* [`nfs_v4_root_export_remounts`](#-nfs--nfs_v4_root_export_remounts) +* [`nfs_v4_root_export_atboot`](#-nfs--nfs_v4_root_export_atboot) +* [`nfs_v4_root_export_options`](#-nfs--nfs_v4_root_export_options) +* [`nfs_v4_root_export_bindmount`](#-nfs--nfs_v4_root_export_bindmount) +* [`nfs_v4_root_export_tag`](#-nfs--nfs_v4_root_export_tag) +* [`client_gssd_service_name`](#-nfs--client_gssd_service_name) +* [`client_services_hasrestart`](#-nfs--client_services_hasrestart) +* [`client_services_hasstatus`](#-nfs--client_services_hasstatus) +* [`client_gssdopt_name`](#-nfs--client_gssdopt_name) + +##### `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.: + * Puppet type reference: {package, "purgeable"}[http://j.mp/xbxmNP] + * {Puppet's package provider source code}[http://j.mp/wtVCaL] +* 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: `$nfs::params::nfs_v4` + +##### `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: `$nfs::params::nfs_v4` + +##### `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: `$nfs::params::nfs_v4_export_root` + +##### `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: `$nfs::params::nfs_v4_export_root_clients` + +##### `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: `$nfs::params::nfs_v4_mount_root` + +##### `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 + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs::client` class: + +* [`ensure`](#-nfs--client--ensure) +* [`nfs_v4`](#-nfs--client--nfs_v4) +* [`nfs_v4_mount_root`](#-nfs--client--nfs_v4_mount_root) +* [`nfs_v4_idmap_domain`](#-nfs--client--nfs_v4_idmap_domain) + +##### `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 + +* Daniel Klockenkaemper +* Martin Alfke + +### `nfs::client::package` + +Class: nfs::client::package + +This Function exists to + 1. install needed packages for nfs clients + +* Daniel Klockenkaemper +* Martin Alfke + +### `nfs::client::service` + +Class: nfs::client::service + +This Function exists to + 1. manage the needed services for nfs clients + +* Daniel Klockenkaemper +* Martin Alfke + +### `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. + +* Daniel Klockenkaemper +* Martin Alfke + +### `nfs::server` + +This class exists to + 1. order the loading of classes + 2. including all needed classes for nfs as a server + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs::server` class: + +* [`ensure`](#-nfs--server--ensure) +* [`nfs_v4`](#-nfs--server--nfs_v4) +* [`nfs_v4_export_root`](#-nfs--server--nfs_v4_export_root) +* [`nfs_v4_export_root_clients`](#-nfs--server--nfs_v4_export_root_clients) +* [`nfs_v4_idmap_domain`](#-nfs--server--nfs_v4_idmap_domain) +* [`nfs_v4_root_export_ensure`](#-nfs--server--nfs_v4_root_export_ensure) +* [`nfs_v4_root_export_mount`](#-nfs--server--nfs_v4_root_export_mount) +* [`nfs_v4_root_export_remounts`](#-nfs--server--nfs_v4_root_export_remounts) +* [`nfs_v4_root_export_atboot`](#-nfs--server--nfs_v4_root_export_atboot) +* [`nfs_v4_root_export_options`](#-nfs--server--nfs_v4_root_export_options) +* [`nfs_v4_root_export_bindmount`](#-nfs--server--nfs_v4_root_export_bindmount) +* [`nfs_v4_root_export_tag`](#-nfs--server--nfs_v4_root_export_tag) + +##### `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 + +* Daniel Klockenkaemper +* Martin Alfke + +### `nfs::server::package` + +Class: nfs::server::package + +This Function exists to + 1. install needed packages for nfs server + +* Daniel Klockenkaemper +* Martin Alfke + +### `nfs::server::service` + +Class: nfs::server::service + +This Function exists to + 1. manage the needed services for nfs server + +* Daniel Klockenkaemper +* Martin Alfke + +## 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' +} + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs::client::mount` defined type: + +* [`server`](#-nfs--client--mount--server) +* [`share`](#-nfs--client--mount--share) +* [`ensure`](#-nfs--client--mount--ensure) +* [`remounts`](#-nfs--client--mount--remounts) +* [`atboot`](#-nfs--client--mount--atboot) +* [`options_nfsv4`](#-nfs--client--mount--options_nfsv4) +* [`options_nfs`](#-nfs--client--mount--options_nfs) +* [`bindmount`](#-nfs--client--mount--bindmount) +* [`nfstag`](#-nfs--client--mount--nfstag) +* [`owner`](#-nfs--client--mount--owner) +* [`group`](#-nfs--client--mount--group) +* [`mode`](#-nfs--client--mount--mode) +* [`mount_root`](#-nfs--client--mount--mount_root) +* [`mount`](#-nfs--client--mount--mount) +* [`manage_packages`](#-nfs--client--mount--manage_packages) +* [`client_packages`](#-nfs--client--mount--client_packages) +* [`nfs_v4`](#-nfs--client--mount--nfs_v4) + +##### `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 + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs::functions::bindmount` defined type: + +* [`mount_name`](#-nfs--functions--bindmount--mount_name) +* [`ensure`](#-nfs--functions--bindmount--ensure) + +##### `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 + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs::functions::create_export` defined type: + +* [`clients`](#-nfs--functions--create_export--clients) +* [`ensure`](#-nfs--functions--create_export--ensure) +* [`owner`](#-nfs--functions--create_export--owner) +* [`group`](#-nfs--functions--create_export--group) +* [`mode`](#-nfs--functions--create_export--mode) + +##### `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 + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs::functions::mkdir` defined type: + +* [`ensure`](#-nfs--functions--mkdir--ensure) + +##### `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 + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs::functions::nfsv4_bindmount` defined type: + +* [`v4_export_name`](#-nfs--functions--nfsv4_bindmount--v4_export_name) +* [`bind`](#-nfs--functions--nfsv4_bindmount--bind) +* [`ensure`](#-nfs--functions--nfsv4_bindmount--ensure) + +##### `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 + +* {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] + + +* Daniel Klockenkaemper +* Martin Alfke + +#### Parameters + +The following parameters are available in the `nfs::server::export` defined type: + +* [`clients`](#-nfs--server--export--clients) +* [`bind`](#-nfs--server--export--bind) +* [`ensure`](#-nfs--server--export--ensure) +* [`remounts`](#-nfs--server--export--remounts) +* [`atboot`](#-nfs--server--export--atboot) +* [`options_nfsv4`](#-nfs--server--export--options_nfsv4) +* [`options_nfs`](#-nfs--server--export--options_nfs) +* [`bindmount`](#-nfs--server--export--bindmount) +* [`nfstag`](#-nfs--server--export--nfstag) +* [`mount`](#-nfs--server--export--mount) +* [`owner`](#-nfs--server--export--owner) +* [`group`](#-nfs--server--export--group) +* [`mode`](#-nfs--server--export--mode) +* [`server`](#-nfs--server--export--server) +* [`v3_export_name`](#-nfs--server--export--v3_export_name) +* [`v4_export_name`](#-nfs--server--export--v4_export_name) +* [`nfsv4_bindmount_enable`](#-nfs--server--export--nfsv4_bindmount_enable) + +##### `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` + diff --git a/manifests/client.pp b/manifests/client.pp index e171d752..3826e333 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,29 +1,32 @@ -# == Class: nfs::client +# Class: nfs::client # +# @summary # This class exists to # 1. order the loading of classes # 2. including all needed classes for nfs as a client # -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @param ensure +# 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'. +# @param nfs_v4 +# 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'. +# @param nfs_v4_mount_root +# The nfs_v4_mount_root parameter is used to determine the root directory for nfs version 4 mounts. +# Default is '/mnt'. +# @param nfs_v4_idmap_domain +# The nfs_v4_idmap_domain parameter is used to determine the domain for nfs version 4 id mapping. +# Default is 'localdomain'. +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::client ( - $ensure = $nfs::ensure, - $nfs_v4 = $nfs::nfs_v4_client, - $nfs_v4_mount_root = $nfs::nfs_v4_mount_root, - $nfs_v4_idmap_domain = $nfs::nfs_v4_idmap_domain, + String $ensure = $nfs::ensure, + Boolean $nfs_v4 = $nfs::nfs_v4_client, + String $nfs_v4_mount_root = $nfs::nfs_v4_mount_root, + String $nfs_v4_idmap_domain = $nfs::nfs_v4_idmap_domain, ) { - anchor { 'nfs::client::begin': } - anchor { 'nfs::client::end': } - # package(s) class { 'nfs::client::package': } @@ -35,18 +38,12 @@ if $ensure == 'present' { # we need the software before configuring it - Anchor['nfs::client::begin'] - -> Class['nfs::client::package'] + Class['nfs::client::package'] -> Class['nfs::client::config'] - # we need the software and a working configuration before running a service - Class['nfs::client::package'] -> Class['nfs::client::service'] - Class['nfs::client::config'] -> Class['nfs::client::service'] - Class['nfs::client::service'] -> Anchor['nfs::client::end'] + -> Class['nfs::client::service'] } else { # make sure all services are getting stopped before software removal - Anchor['nfs::client::begin'] - -> Class['nfs::client::service'] + Class['nfs::client::service'] -> Class['nfs::client::package'] - -> Anchor['nfs::client::end'] } } diff --git a/manifests/client/config.pp b/manifests/client/config.pp index 6c4e92b3..d9e4c52c 100644 --- a/manifests/client/config.pp +++ b/manifests/client/config.pp @@ -1,19 +1,12 @@ -# == Class: nfs::client::config -# +# Class: nfs::client::config +# @summary # This Function exists to # 1. configure nfs as a client # -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::client::config { if $nfs::client::nfs_v4 { if $nfs::defaults_file != undef { @@ -46,14 +39,18 @@ if $nfs::client_d9_gssdopt_workaround and $nfs::client_gssd_service { file_line { 'rpc-gssd.service': - path => '/lib/systemd/system/rpc-gssd.service', - match => 'EnvironmentFile', - line => 'EnvironmentFile=-/etc/default/nfs-common', - require => Package['nfs-common'], - } ~> exec { 'systemctl daemon-reload': + path => '/lib/systemd/system/rpc-gssd.service', + match => 'EnvironmentFile', + line => 'EnvironmentFile=-/etc/default/nfs-common', + } + exec { 'systemctl daemon-reload': refreshonly => true, path => '/bin', - } ~> Service['rpc-gssd'] + } + Package['nfs-common'] + -> File_line['rpc-gssd.service'] + ~> Exec['systemctl daemon-reload'] + ~> Service['rpc-gssd'] } if ( $nfs::server_enabled == false ) or ( $nfs::server_enabled == true and $nfs::nfs_v4 == false ) { diff --git a/manifests/client/mount.pp b/manifests/client/mount.pp index 9101abf0..043ccc5e 100644 --- a/manifests/client/mount.pp +++ b/manifests/client/mount.pp @@ -1,55 +1,60 @@ -# == Function: nfs::client::mount +# Function: nfs::client::mount # +# @summary # This Function exists to # 1. manage all mounts on a nfs client # -# === Parameters +# Parameters # -# [*server*] +# @param server # String. Sets the ip address of the server with the nfs export # -# [*share*] +# @param share # String. Sets the name of the nfs share on the server # -# [*ensure*] +# @param ensure # String. Sets the ensure parameter of the mount. # -# [*remounts*] +# @param remounts # String. Sets the remounts parameter of the mount. # -# [*atboot*] +# @param atboot # String. Sets the atboot parameter of the mount. # -# [*options_nfsv4*] +# @param options_nfsv4 # String. Sets the mount options for a nfs version 4 mount. # -# [*options_nfs*] +# @param options_nfs # String. Sets the mount options for a nfs mount. # -# [*bindmount*] +# @param bindmount # String. When not undef it will create a bindmount on the node # for the nfs mount. # -# [*nfstag*] +# @param nfstag # String. Sets the nfstag parameter of the mount. # -# [*nfs_v4*] +# param nfs_v4 # Boolean. When set to true, it uses nfs version 4 to mount a share. # -# [*owner*] +# @param owner # String. Set owner of mount dir # -# [*group*] +# @param group # String. Set group of mount dir # -# [*mode*] +# @param mode # String. Set mode of mount dir # -# [*mount_root*] +# @param mount_root # String. Overwrite mount root if differs from server config # - -# === Examples +# @param mount +# @param manage_packages +# @param client_packages +# @param nfs_v4 +# +# @example # # class { '::nfs': # client_enabled => true, @@ -64,29 +69,28 @@ # options_nfsv4 => 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3' # } # -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - define nfs::client::mount ( - $server, - $share = undef, - $ensure = 'mounted', - $mount = $title, - $remounts = false, - $atboot = false, - $options_nfsv4 = $nfs::client_nfsv4_options, - $options_nfs = $nfs::client_nfs_options, - $bindmount = undef, - $nfstag = undef, - $nfs_v4 = $nfs::client::nfs_v4, - $owner = undef, - $group = undef, - $mode = undef, - $mount_root = undef, - $manage_packages = $nfs::manage_packages, - $client_packages = $nfs::effective_client_packages, + String[1] $server, + Optional[String[1]] $share = undef, + String[1] $ensure = 'mounted', + String[1] $mount = $title, + Boolean $remounts = false, + Boolean $atboot = false, + String[1] $options_nfsv4 = $nfs::client_nfsv4_options, + String[1] $options_nfs = $nfs::client_nfs_options, + Optional[String[1]] $bindmount = undef, + Optional[String[1]] $nfstag = undef, + Boolean $nfs_v4 = $nfs::client::nfs_v4, + Optional[String[1]] $owner = undef, + Optional[String[1]] $group = undef, + Optional[String[1]] $mode = undef, + Optional[String[1]] $mount_root = undef, + Boolean $manage_packages = $nfs::manage_packages, + Optional[Variant[String[1], Array[String[1]]]] $client_packages = $nfs::effective_client_packages, ) { if $manage_packages and $client_packages != undef { $mount_require = [Nfs::Functions::Mkdir[$mount], Package[$client_packages]] diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 1a01b27e..5b731568 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -1,19 +1,13 @@ -# == Class: nfs::client::package +# Class: nfs::client::package # +# @summary # This Function exists to # 1. install needed packages for nfs clients # -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::client::package { if $nfs::manage_packages { if $nfs::client::nfs_v4 { diff --git a/manifests/client/service.pp b/manifests/client/service.pp index 0a9a5b33..5531c654 100644 --- a/manifests/client/service.pp +++ b/manifests/client/service.pp @@ -1,19 +1,13 @@ -# == Class: nfs::client::service +# Class: nfs::client::service # +# @summary # This Function exists to # 1. manage the needed services for nfs clients # -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::client::service { if $nfs::client::nfs_v4 { $create_services = $nfs::effective_nfsv4_client_services diff --git a/manifests/functions/bindmount.pp b/manifests/functions/bindmount.pp index a309ddd6..faf1abec 100644 --- a/manifests/functions/bindmount.pp +++ b/manifests/functions/bindmount.pp @@ -1,33 +1,22 @@ -# == Function: nfs::functions::bindmount +# Function: nfs::functions::bindmount # +# @summary # This Function exists to # 1. manage bindmounts # -# === Parameters -# -# [*mount_name*] +# @param mount_name # String. Sets the target directory for the bindmount # -# [*ensure*] +# @param ensure # String. Sets if enabled or not. # -# === Examples -# -# This Function should not be called directly. -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - define nfs::functions::bindmount ( - $mount_name = undef, - $ensure = 'present', + Optional[String[1]] $mount_name = undef, + String[1] $ensure = 'present', ) { nfs::functions::mkdir { $mount_name: ensure => $ensure, diff --git a/manifests/functions/create_export.pp b/manifests/functions/create_export.pp index f3f42ffe..b6101353 100644 --- a/manifests/functions/create_export.pp +++ b/manifests/functions/create_export.pp @@ -1,45 +1,34 @@ -# == Function: nfs::functions::create_export +# Function: nfs::functions::create_export # +# @summary # This Function exists to # 1. manage export creation # -# === Parameters -# -# [*clients*] +# @param clients # String or Array. Sets the clients allowed to mount the export with options. # -# [*ensure*] +# @param ensure # String. Sets if enabled or not. # -# [*owner*] +# @param owner # String. Sets the owner of the exported directory. # -# [*group*] +# @param group # String. Sets the group of the exported directory. # -# [*mode*] +# @param mode # String. Sets the permissions of the exported directory. # -# === Examples -# -# This Function should not be called directly. -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - define nfs::functions::create_export ( - $clients, - $ensure = 'present', - $owner = undef, - $group = undef, - $mode = undef, + Variant[String[1], Array[String[1]]] $clients, + String[1] $ensure = 'present', + Optional[String[1]] $owner = undef, + Optional[String[1]] $group = undef, + Optional[String[1]] $mode = undef, ) { if $ensure != 'absent' { $line = "${name} ${join(any2array($clients),' ')}\n" diff --git a/manifests/functions/mkdir.pp b/manifests/functions/mkdir.pp index 9fe16844..97dd0a8b 100644 --- a/manifests/functions/mkdir.pp +++ b/manifests/functions/mkdir.pp @@ -1,28 +1,17 @@ -# == Function: nfs::functions::mkdir +# Function: nfs::functions::mkdir # +# @summary # This Function exists to # 1. manage dir creation # -# === Parameters -# -# None -# -# === Examples -# -# This Function should not be called directly. -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors +# @param ensure # +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - define nfs::functions::mkdir ( - $ensure = 'present', + String[1] $ensure = 'present', ) { if $ensure != 'absent' { exec { "mkdir_recurse_${name}": diff --git a/manifests/functions/nfsv4_bindmount.pp b/manifests/functions/nfsv4_bindmount.pp index 104386f5..6435f288 100644 --- a/manifests/functions/nfsv4_bindmount.pp +++ b/manifests/functions/nfsv4_bindmount.pp @@ -1,37 +1,26 @@ -# == Function: nfs::functions::nfsv4_bindmount +# Function: nfs::functions::nfsv4_bindmount # +# @summary # This Function exists to # 1. manage bindmounts for nfs4 # -# === Parameters -# -# [*v4_export_name*] +# @param v4_export_name # String. Sets the target directory for the bindmount # -# [*bind*] +# @param bind # String. Sets the bindmount options. # -# [*ensure*] +# @param ensure # String. Sets if mounted or not. # -# === Examples -# -# This Function should not be called directly. -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - define nfs::functions::nfsv4_bindmount ( - $v4_export_name, - $bind, - $ensure = 'mounted', + String[1] $v4_export_name, + String[1] $bind, + String[1] $ensure = 'mounted', ) { $normalize_export_root = regsubst($nfs::server::nfs_v4_export_root, '/$', '') $expdir = "${normalize_export_root}/${v4_export_name}" diff --git a/manifests/init.pp b/manifests/init.pp index b5a62b3a..55f61afd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,9 +1,6 @@ -# == Class: nfs::init +# Class: nfs::init # -# This class exists to -# === Parameters -# -# [*ensure*] +# @param ensure # String. Controls if the managed resources shall be present or # absent. If set to absent: # * The managed software packages are being uninstalled. @@ -16,260 +13,218 @@ # (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*] +# @param server_enabled # Boolean. If set to true, this module will configure the node # to act as a nfs server. -# -# [*client_enabled*] +# @param client_enabled # 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*] +# @param storeconfigs_enabled # Boolean. If set to false, this module will not export any # resources as storeconfigs. Defaults to true. -# -# [*nfs_v4*] +# @param nfs_v4 # Boolean. If set to true, this module will use nfs version 4 # for exporting and mounting nfs resources. -# -# [*nfs_v4_client*] +# @param nfs_v4_client # 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 [*nfs_v4*] -# -# [*exports_file*] +# version 3 to mount nfs resources. It defaults to the setting of @param nfs_v4 +# @param exports_file # String. It defines the location of file with the nfs export resources used # by the nfs server. -# -# [*idmapd_file*] +# @param idmapd_file # String. It defines the location of the file with the idmapd settings. -# -# [*defaults_file*] +# @param defaults_file # String. It defines the location of the file with the nfs settings. -# -# [*manage_packages*] +# @param manage_packages # Boolean. It defines if the packages should be managed through this module -# -# [*server_packages*] +# @param server_packages # Array. It defines the packages needed to be installed for acting as # a nfs server -# -# [*server_package_ensure*] +# @param server_package_ensure # String. It defines the packages state - any of present, installed, # absent, purged, held, latest -# -# [*client_packages*] +# @param client_packages # Array. It defines the packages needed to be installed for acting as # a nfs client -# -# [*client_package_ensure*] +# @param client_package_ensure # String. It defines the packages state - any of present, installed, # absent, purged, held, latest -# -# [*manage_server_service*] +# @param manage_server_service # Boolean. Defines if module should manage server_service -# -# [*manage_server_servicehelper*] +# @param manage_server_servicehelper # Boolean. Defines if module should manage server_servicehelper -# -# [*manage_client_service*] +# @param manage_client_service # Boolean. Defines if module should manage client_service -# -# [*server_service_name*] +# @param server_service_name # String. It defines the servicename of the nfs server service -# -# [*server_service_ensure*] +# @param server_service_ensure # Boolean. It defines the service parameter ensure for nfs server services. -# -# [*server_service_enable*] +# @param server_service_enable # Boolean. It defines the service parameter enable for nfs server service. -# -# [*server_service_hasrestart*] +# @param server_service_hasrestart # Boolean. It defines the service parameter hasrestart for nfs server service. -# -# [*server_service_hasstatus*] +# @param server_service_hasstatus # Boolean. It defines the service parameter hasstatus for nfs server service. -# -# [*server_service_restart_cmd*] +# @param server_service_restart_cmd # String. It defines the service parameter restart for nfs server service. -# -# [*server_nfsv4_servicehelper*] +# @param server_nfsv4_servicehelper # Array. It defines the service helper like idmapd for servers configured with # nfs version 4. -# -# [*client_services*] +# @param client_services # Nested Hash. It defines the servicenames need to be started when acting as a nfs client -# -# [*client_nfsv4_services*] +# @param client_nfsv4_services # Nested Hash. It defines the servicenames need to be started when acting as a nfs client # version 4. -# -# [*client_services_enable*] +# @param client_services_enable # Boolean. It defines the service parameter enable for nfs client services. -# -# [*client_service_hasrestart*] -# Boolean. It defines the service parameter hasrestart for nfs client services. -# -# [*client_service_hasstatus*] -# Boolean. It defines the service parameter hasstatus for nfs client services. -# -# [*client_idmapd_setting*] -# Array. It defines the Augeas parameter added in [*defaults_file*] when acting as a nfs +# @param 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*] +# @param 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*] +# @param 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*] +# @param 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*] +# @param 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*] +# @param nfs_v4_export_root # 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*] +# @param nfs_v4_export_root_clients # 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*] +# @param nfs_v4_mount_root # 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. It defines the name of the idmapd domain setting in [*idmapd_file*] needed +# @param 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*] +# @param nfsv4_bindmount_enable # Boolean. It defines if the module should create a bindmount for the export. # Defaults to true. -# -# [*client_need_gssd*] +# @param client_need_gssd # Boolean. If true, sets NEED_GSSD=yes in /etc/defauls/nfs-common, usable on Debian/Ubuntu -# -# [*client_gssd_service*] +# @param client_gssd_service # Boolean. If true enable rpc-gssd service. -# -# [*client_gssd_options*] +# @param client_gssd_options # String. Options for rpc-gssd service. Defaults to '' -# -# [*client_d9_gssdopt_workaround*] +# @param client_d9_gssdopt_workaround # Boolean. If enabled, workaround for passing gssd_options which is broken on Debian 9. Usable only on Debian 9 -# -# [*nfs_v4_idmap_localrealms*] +# @param nfs_v4_idmap_localrealms # String or Array. 'Local-Realms' option for idmapd. Defaults to '' -# -# [*nfs_v4_idmap_cache*] +# @param nfs_v4_idmap_cache # Integer. 'Cache-Expiration' option for idmapd. Defaults to 0 - unused. -# -# [*manage_nfs_v4_idmap_nobody_mapping*] +# @param manage_nfs_v4_idmap_nobody_mapping # Boolean. Enable setting Nobody mapping in idmapd. Defaults to false. -# -# [*nfs_v4_idmap_nobody_user*] +# @param nfs_v4_idmap_nobody_user # String. 'Nobody-User' option for idmapd. Defaults to nobody. -# -# [*nfs_v4_idmap_nobody_group*] +# @param nfs_v4_idmap_nobody_group # String. 'Nobody-Group' option for idmapd. Defaults to nobody or nogroup. -# -# [*client_rpcbind_config*] +# @param client_rpcbind_config # String. It defines the location of the file with the rpcbind config. -# -# [*client_rpcbind_optname*] +# @param client_rpcbind_optname # String. It defines the name of env variable that holds the rpcbind config. E.g. OPTIONS for Debian -# -# [*client_rpcbind_opts*] +# @param client_rpcbind_opts # String. Options for rpcbind service. +# @param nfs_v4_root_export_ensure +# String. It defines the state of the nfs version 4 root export. Defaults to mounted. +# @param nfs_v4_root_export_mount +# String. It defines the mountpoint of the nfs version 4 root export. Defaults to undef. +# @param nfs_v4_root_export_remounts +# Boolean. It defines if the nfs version 4 root export should be remounted. Defaults to false. +# @param nfs_v4_root_export_atboot +# Boolean. It defines if the nfs version 4 root export should be mounted at boot. Defaults to false. +# @param nfs_v4_root_export_options +# String. It defines the options for the nfs version 4 root export. Defaults to _netdev. +# @param nfs_v4_root_export_bindmount +# String. It defines the bindmount of the nfs version 4 root export. Defaults to undef. +# @param nfs_v4_root_export_tag +# String. It defines the tag of the nfs version 4 root export. Defaults to undef. +# @param client_gssd_service_name +# Hash. It defines the servicename of the rpc-gssd service. +# @param client_services_hasrestart +# Boolean. It defines the service parameter hasrestart for nfs client services. +# @param client_services_hasstatus +# Boolean. It defines the service parameter hasstatus for nfs client services. +# @param client_gssdopt_name +# String. It defines the name of the gssd option in /etc/default/nfs-common. +# @example +# * {Please take a look at} [https://github.com/voxpupuli/puppet-nfs#examples] # -# -# === Examples -# -# * {Please take a look at} [https://github.com/derdanne/puppet-nfs#examples] -# -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - 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 = $nfs::params::nfs_v4, - Boolean $nfs_v4_client = $nfs::params::nfs_v4, - 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, - $client_services = $nfs::params::client_services, - $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, - $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 = $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_idmap_domain = $nfs::params::nfs_v4_idmap_domain, - Variant[String, Array] $nfs_v4_idmap_localrealms = '', - 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, + Enum['present', 'absent', 'running', 'stopped', 'disabled'] $ensure = 'present', + Boolean $server_enabled = false, + Boolean $client_enabled = false, + Boolean $storeconfigs_enabled = true, + Boolean $nfs_v4 = $nfs::params::nfs_v4, + Boolean $nfs_v4_client = $nfs::params::nfs_v4, + 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 = $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_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 { diff --git a/manifests/params.pp b/manifests/params.pp index 646559f8..416e0c7f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,5 +1,6 @@ -# == Class: nfs::params +# Class: nfs::params # +# @summary # This class exists to # 1. Declutter the default value assignment for class parameters. # 2. Manage internally used module variables in a central place. @@ -7,27 +8,10 @@ # Therefore, many operating system dependent differences (names, paths, ...) # are addressed in here. # -# -# === Parameters -# -# This class does not provide any parameters. -# -# -# === Examples -# -# This class is not intended to be used directly. -# -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::params { #### Default values for the parameters of the main module class, init.pp diff --git a/manifests/server.pp b/manifests/server.pp index 68c0b5bf..7b337936 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -1,36 +1,39 @@ -# == Class: nfs::server -# +# @summary Class: nfs::server # This class exists to # 1. order the loading of classes # 2. including all needed classes for nfs as a server # -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors +# @param ensure +# @param nfs_v4 +# @param nfs_v4_export_root +# @param nfs_v4_export_root_clients +# @param nfs_v4_idmap_domain +# @param nfs_v4_root_export_ensure +# @param nfs_v4_root_export_mount +# @param nfs_v4_root_export_remounts +# @param nfs_v4_root_export_atboot +# @param nfs_v4_root_export_options +# @param nfs_v4_root_export_bindmount +# @param nfs_v4_root_export_tag # +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::server ( - $ensure = $nfs::ensure, - $nfs_v4 = $nfs::nfs_v4, - $nfs_v4_export_root = $nfs::nfs_v4_export_root, - $nfs_v4_export_root_clients = $nfs::nfs_v4_export_root_clients, - $nfs_v4_idmap_domain = $nfs::nfs_v4_idmap_domain, - $nfs_v4_root_export_ensure = $nfs::nfs_v4_root_export_ensure, - $nfs_v4_root_export_mount = $nfs::nfs_v4_root_export_mount, - $nfs_v4_root_export_remounts = $nfs::nfs_v4_root_export_remounts, - $nfs_v4_root_export_atboot = $nfs::nfs_v4_root_export_atboot , - $nfs_v4_root_export_options = $nfs::nfs_v4_root_export_options, - $nfs_v4_root_export_bindmount = $nfs::nfs_v4_root_export_bindmount, - $nfs_v4_root_export_tag = $nfs::nfs_v4_root_export_tag, + Enum['present', 'absent', 'running', 'stopped', 'disabled'] $ensure = $nfs::ensure, + Boolean $nfs_v4 = $nfs::nfs_v4, + String $nfs_v4_export_root = $nfs::nfs_v4_export_root, + String $nfs_v4_export_root_clients = $nfs::nfs_v4_export_root_clients, + String $nfs_v4_idmap_domain = $nfs::nfs_v4_idmap_domain, + String $nfs_v4_root_export_ensure = $nfs::nfs_v4_root_export_ensure, + Optional[String] $nfs_v4_root_export_mount = $nfs::nfs_v4_root_export_mount, + Boolean $nfs_v4_root_export_remounts = $nfs::nfs_v4_root_export_remounts, + Boolean $nfs_v4_root_export_atboot = $nfs::nfs_v4_root_export_atboot , + String $nfs_v4_root_export_options = $nfs::nfs_v4_root_export_options, + Optional[String] $nfs_v4_root_export_bindmount = $nfs::nfs_v4_root_export_bindmount, + Optional[String] $nfs_v4_root_export_tag = $nfs::nfs_v4_root_export_tag, ) { - anchor { 'nfs::server::begin': } - anchor { 'nfs::server::end': } - # package(s) class { 'nfs::server::package': } @@ -42,18 +45,12 @@ if $ensure == 'present' { # we need the software before configuring it - Anchor['nfs::server::begin'] - -> Class['nfs::server::package'] + Class['nfs::server::package'] -> Class['nfs::server::config'] - # we need the software and a working configuration before running a service - Class['nfs::server::package'] -> Class['nfs::server::service'] - Class['nfs::server::config'] -> Class['nfs::server::service'] - Class['nfs::server::service'] -> Anchor['nfs::server::end'] + -> Class['nfs::server::service'] } else { # make sure all services are getting stopped before software removal - Anchor['nfs::server::begin'] - -> Class['nfs::server::service'] + Class['nfs::server::service'] -> Class['nfs::server::package'] - -> Anchor['nfs::server::end'] } } diff --git a/manifests/server/config.pp b/manifests/server/config.pp index cc2c2dea..989958a8 100644 --- a/manifests/server/config.pp +++ b/manifests/server/config.pp @@ -1,19 +1,13 @@ -# == Class: nfs::server::config +# Class: nfs::server::config # +# @summary # This class exists to # 1. configure nfs as a server # -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::server::config { concat { $nfs::exports_file: ensure => present, diff --git a/manifests/server/export.pp b/manifests/server/export.pp index 82830807..3b5a26bf 100644 --- a/manifests/server/export.pp +++ b/manifests/server/export.pp @@ -1,58 +1,63 @@ -# == Function: nfs::server::export +# Function: nfs::server::export # +# @summary # This Function exists to # 1. manage all exported resources on a nfs server # -# === Parameters +# Parameters # -# [*clients*] +# @param clients # String or Array. Sets the allowed clients and options for the export in the exports file. # Defaults to localhost(ro) # -# [*bind*] +# @param bind # String. Sets the bind options setted in /etc/fstab for the bindmounts created. # Defaults to rbind # -# [*ensure*] +# @param ensure # String. If enabled the mount will be created. Defaults to mounted # -# [*remounts*] +# @param remounts # String. Sets the remounts parameter of the mount. # -# [*atboot*] +# @param atboot # String. Sets the atboot parameter of the mount. # -# [*options_nfsv4*] +# @param options_nfsv4 # String. Sets the mount options for a nfs version 4 exported resource mount. # -# [*options_nfs*] +# @param options_nfs # String. Sets the mount options for a nfs exported resource mount. # -# [*bindmount*] +# @param bindmount # String. When not undef it will create a bindmount on the node # for the nfs mount. # -# [*nfstag*] +# @param nfstag # String. Sets the nfstag parameter of the mount. # -# [*mount*] +# @param mount # 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 # -# [*owner*] +# @param owner # String. Sets the owner of the exported directory # -# [*group*] +# @param group # String. Sets the group of the exported directory # -# [*mode*] +# @param mode # String. Sets the permissions of the exported directory. # -# [*server*] +# @param server # String. Sets the hostname clients will use to mount the exported resource. If undef it # defaults to the trusted certname # -# === Examples +# @param v3_export_name +# @param v4_export_name +# @param nfsv4_bindmount_enable +# +# @examples # # class { '::nfs': # server_enabled => true, @@ -66,36 +71,36 @@ # share => 'share_name_on_nfs_server', # } # -# === Links +# Links # # * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] # # -# === Authors +# @author # # * Daniel Klockenkaemper +# * Martin Alfke # - define nfs::server::export ( - $v3_export_name = $name, - $v4_export_name = regsubst($name, '.*/(.*)', '\1' ), - $clients = 'localhost(ro)', - $bind = 'rbind', + String[1] $v3_export_name = $name, + String[1] $v4_export_name = regsubst($name, '.*/(.*)', '\1' ), + String[1] $clients = 'localhost(ro)', + String[1] $bind = 'rbind', # globals for this share # propogated to storeconfigs - $ensure = 'mounted', - $mount = undef, - $remounts = false, - $atboot = false, - $options_nfsv4 = $nfs::client_nfsv4_options, - $options_nfs = $nfs::client_nfs_options, - $bindmount = undef, - $nfstag = undef, - $owner = undef, - $group = undef, - $mode = undef, - $server = $facts['clientcert'], - $nfsv4_bindmount_enable = $nfs::nfsv4_bindmount_enable, + String[1] $ensure = 'mounted', + Optional[String[1]] $mount = undef, + Boolean $remounts = false, + Boolean $atboot = false, + String[1] $options_nfsv4 = $nfs::client_nfsv4_options, + String[1] $options_nfs = $nfs::client_nfs_options, + Optional[String[1]] $bindmount = undef, + Optional[String[1]] $nfstag = undef, + Optional[String[1]] $owner = undef, + Optional[String[1]] $group = undef, + Optional[String[1]] $mode = undef, + String[1] $server = $facts['clientcert'], + Boolean $nfsv4_bindmount_enable = $nfs::nfsv4_bindmount_enable, ) { if $nfs::server::nfs_v4 { if $nfsv4_bindmount_enable { diff --git a/manifests/server/package.pp b/manifests/server/package.pp index 19e1290d..3ee9128c 100644 --- a/manifests/server/package.pp +++ b/manifests/server/package.pp @@ -1,19 +1,13 @@ -# == Class: nfs::server::package +# Class: nfs::server::package # +# @summary # This Function exists to # 1. install needed packages for nfs server # -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::server::package { if $nfs::manage_packages { if $nfs::manage_server_service { diff --git a/manifests/server/service.pp b/manifests/server/service.pp index 3bc44009..7360d768 100644 --- a/manifests/server/service.pp +++ b/manifests/server/service.pp @@ -1,19 +1,13 @@ -# == Class: nfs::server::service +# Class: nfs::server::service # +# @summary # This Function exists to # 1. manage the needed services for nfs server # -# -# === Links -# -# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY] -# -# -# === Authors -# +# @author # * Daniel Klockenkaemper +# * Martin Alfke # - class nfs::server::service { if $nfs::nfs_v4 == true { if $nfs::server_nfsv4_servicehelper != undef and $nfs::manage_server_servicehelper { diff --git a/metadata.json b/metadata.json index 0b34eb4e..a483a441 100644 --- a/metadata.json +++ b/metadata.json @@ -1,27 +1,26 @@ { - "name": "derdanne-nfs", + "name": "puppet-nfs", "version": "2.1.11", - "source": "https://github.com/derdanne/puppet-nfs.git", - "author": "derdanne", + "source": "https://github.com/voxpupuli/puppet-nfs.git", + "author": "Voxpupuli Community", "license": "Apache-2.0", "summary": "Installs and configures NFS server and clients", - "project_page": "https://github.com/derdanne/puppet-nfs", - "issues_url": "https://github.com/derdanne/puppet-nfs/issues", + "project_page": "https://github.com/voxpupuli/puppet-nfs", + "issues_url": "https://github.com/voxpupuli/puppet-nfs/issues", "dependencies": [ - {"name":"puppetlabs/stdlib","version_requirement":">= 4.5.0 < 9.0.0"}, - {"name":"puppetlabs/concat","version_requirement":">= 1.1.2 < 8.0.0"}, - {"name":"puppetlabs/transition","version_requirement":">= 0.1.0 < 2.0.0"}, - {"name":"puppet/augeasproviders_core","version_requirement":">= 2.1.5 < 4.0.0"}, - {"name":"puppet/augeasproviders_shellvar","version_requirement":">= 1.2.0 <= 5.0.0"} + {"name":"puppetlabs/stdlib","version_requirement":">= 4.5.0 < 10.0.0"}, + {"name":"puppetlabs/concat","version_requirement":">= 1.1.2 < 10.0.0"}, + {"name":"puppetlabs/transition","version_requirement":">= 0.1.0 < 3.0.0"}, + {"name":"puppet/augeasproviders_core","version_requirement":">= 2.1.5 < 5.0.0"}, + {"name":"puppet/augeasproviders_shellvar","version_requirement":">= 1.2.0 <= 7.0.0"}, + {"name":"puppetlabs/augeas_core","version_requirement":">= 1.2.0 <= 2.0.0"}, + {"name":"puppetlabs/mount_core","version_requirement":">= 1.2.0 <= 2.0.0"} ], "tags": ["nfs", "nfs4", "exports", "mount", "mfc"], "operatingsystem_support": [ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "14.04", - "16.04", - "18.04", "20.04", "22.04" ] @@ -29,10 +28,6 @@ { "operatingsystem": "Debian", "operatingsystemrelease": [ - "6", - "7", - "8", - "9", "10", "11" ] @@ -61,18 +56,12 @@ "operatingsystemrelease": [ "13" ] - }, - { - "operatingsystem": "Archlinux", - "operatingsystemrelease": [ - "1.0" - ] } ], "requirements": [ { "name": "puppet", - "version_requirement": ">= 4.0.0 < 8.0.0" + "version_requirement": ">= 7.0.0 < 9.0.0" } ] } diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 751b5a6f..156ad75b 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -3,24 +3,24 @@ require 'spec_helper_acceptance' describe 'nfs class' do - case fact('osfamily') + case fact('os.family') when 'Debian' - case fact('lsbdistcodename') + case fact('os.distro.codename') when 'jessie', 'wheezy' - server_service = 'nfs-kernel-server' + # server_service = 'nfs-kernel-server' server_servicehelpers = %w[nfs-common] client_services = %w[rpcbind nfs-common] when 'trusty' - server_service = 'nfs-kernel-server' + # server_service = 'nfs-kernel-server' server_servicehelpers = '' client_services = %w[rpcbind] - when 'bionic', 'focal' - server_service = 'nfs-kernel-server' - server_servicehelpers = %w[nfs-idmapd] - client_services = %w[rpcbind] + # when 'bionic', 'focal' + # server_service = 'nfs-kernel-server' + # server_servicehelpers = %w[nfs-idmapd] + # client_services = %w[rpcbind] else - server_service = 'nfs-server' + # server_service = 'nfs-server' server_servicehelpers = %w[nfs-idmapd] client_services = %w[rpcbind] end @@ -28,13 +28,13 @@ client_packages = %w[nfs-common nfs4-acl-tools rpcbind] when 'RedHat' - case fact('operatingsystemmajrelease') + case fact('os.release.major') when '6' - server_service = 'nfs' + # server_service = 'nfs' server_servicehelpers = %w[rpcidmapd rpcbind] client_services = %w[rpcbind] when '7' - server_service = 'nfs-server.service' + # server_service = 'nfs-server.service' server_servicehelpers = %w[nfs-idmap.service] client_services = %w[rpcbind.service rpcbind.socket] end @@ -80,7 +80,7 @@ class { '::nfs': client_services.each do |service| # puppet reports wrong status for nfs-common on wheezy - if service == 'nfs-common' && fact('lsbdistcodename') == 'wheezy' + if service == 'nfs-common' && fact('os.distro.codename') == 'wheezy' puts 'puppet reports wrong status for nfs-common on wheezy' else describe service(service) do @@ -89,9 +89,10 @@ class { '::nfs': end end - describe service(server_service) do - it { is_expected.not_to be_running } - end + puts 'server services can not be started due to container and kernel modules' + # describe service(server_service) do + # it { is_expected.not_to be_running } + # end server_packages_only = server_packages - client_packages server_packages_only.each do |package| @@ -105,7 +106,7 @@ class { '::nfs': describe 'include nfs with server params' do context 'when server params' do server_pp = <<-PUPPETCODE - file { ['/data_folder', '/homeexport']: + file { ['/export', '/data_folder', '/homeexport']: ensure => 'directory', } class { '::nfs': @@ -118,11 +119,13 @@ class { '::nfs': nfs::server::export { '/data_folder': ensure => 'mounted', clients => '*(rw,insecure,async,no_root_squash,no_subtree_check)', + before => Class['nfs::server::service'], } nfs::server::export { '/homeexport': ensure => 'mounted', clients => '*(rw,insecure,async,root_squash,no_subtree_check)', mount => '/srv/home', + before => Class['nfs::server::service'], } PUPPETCODE @@ -141,23 +144,25 @@ class { '::nfs': end # Buggy nfs-kernel-server does not run in docker with Ubuntu 14.04, Debian wheezy and CentOs 6 images - if fact('lsbdistcodename') == 'trusty' || fact('lsbdistcodename') == 'wheezy' || (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') == '6') + if fact('os.distro.codename') == 'trusty' || fact('os.distro.codename') == 'wheezy' || (fact('os.family') == 'RedHat' && fact('os.release.major') == '6') puts 'Buggy nfs-kernel-server does not run in docker with Ubuntu 14.04, Debian wheezy and CentOs 6 images' else - describe service(server_service) do - it { is_expected.to be_running } - end + puts 'server services can not be started due to container and kernel modules' + # describe service(server_service) do + # it { is_expected.to be_running } + # end end if server_servicehelpers != '' server_servicehelpers.each do |server_servicehelper| # puppet reports wrong status for nfs-common on wheezy - if server_servicehelper == 'nfs-common' && fact('lsbdistcodename') == 'wheezy' + if server_servicehelper == 'nfs-common' && fact('os.distro.codename') == 'wheezy' puts 'puppet reports wrong status for nfs-common on wheezy' else - describe service(server_servicehelper) do - it { is_expected.to be_running } - end + puts 'server services can not be started due to container and kernel modules' + # describe service(server_servicehelper) do + # it { is_expected.to be_running } + # end end end end diff --git a/spec/classes/nfs_spec.rb b/spec/classes/nfs_spec.rb index 586963f4..0926f7fc 100644 --- a/spec/classes/nfs_spec.rb +++ b/spec/classes/nfs_spec.rb @@ -4,7 +4,7 @@ describe 'nfs' do # supported_os = %w[Ubuntu_default Ubuntu_16.04 Debian_default Debian_8 RedHat_default RedHat_7 RedHat_75 RedHat_8 Gentoo SLES Archlinux] - supported_os = %w[Ubuntu_16.04 Ubuntu_18.04 Ubuntu_20.04 Ubuntu_22.04 Debian_8 Debian_9 Debian_10 Debian_11 RedHat_default RedHat_7 RedHat_75 RedHat_8 Gentoo SLES] + supported_os = %w[Ubuntu_20.04 Ubuntu_22.04 Debian_10 Debian_11 RedHat_default RedHat_7 RedHat_75 RedHat_8 Gentoo SLES] supported_os.each do |os| context os do let(:default_facts) do @@ -152,12 +152,12 @@ 'os' => { 'family' => 'Debian', 'distro' => { - 'codename' => 'focal' + 'codename' => 'jammy' }, 'release' => { - 'major' => '20', + 'major' => '22', 'minor' => '04', - 'full' => '20.04' + 'full' => '22.04' } } ) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index a3c60c2e..b2efb870 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,27 +1,33 @@ # frozen_string_literal: true -RSpec.configure do |c| - c.mock_with :rspec -end +# RSpec.configure do |c| +# c.mock_with :rspec +# end +require 'voxpupuli/acceptance/spec_helper_acceptance' +# require 'beaker-rspec/spec_helper' +# require 'beaker/puppet_install_helper' -require 'beaker-rspec/spec_helper' -require 'beaker/puppet_install_helper' +# run_puppet_install_helper -run_puppet_install_helper +# RSpec.configure do |c| +# module_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) +# +# c.formatter = :documentation +# +# c.before :suite do +# puppet_module_install( +# source: module_root, +# module_name: 'nfs' +# ) +# hosts.each do |host| +# on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1] +# on host, puppet('module', 'install', 'puppetlabs-concat'), acceptable_exit_codes: [0, 1] +# end +# end +# end -RSpec.configure do |c| - module_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) - - c.formatter = :documentation - - c.before :suite do - puppet_module_install( - source: module_root, - module_name: 'nfs' - ) - hosts.each do |host| - on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1] - on host, puppet('module', 'install', 'puppetlabs-concat'), acceptable_exit_codes: [0, 1] - end - end -end +# configure_beaker do |host| +# on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1] +# on host, puppet('module', 'install', 'puppetlabs-concat'), acceptable_exit_codes: [0, 1] +# end +configure_beaker