Home

Awesome

nfs cookbook

Cookbook Version CI State OpenCollective OpenCollective License

Description

Installs and configures NFS client and server components

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

Should work on any RHEL 7+, Debian 10+, Ubuntu 18.04+ distributions.

This cookbook depends on the line cookbook

Attributes

Usage

To install the NFS components for a client system, simply add nfs to the run list.

name "base"
description "Role applied to all systems"
run_list [ "nfs" ]

Then in an nfs_server.rb role that is applied to NFS servers:

name "nfs_server"
description "Role applied to the system that should be an NFS server."
override_attributes(
  "nfs" => {
    "packages" => [ "portmap", "nfs-common", "nfs-kernel-server" ],
    "port" => {
      "statd" => 32765,
      "statd_out" => 32766,
      "mountd" => 32767,
      "lockd" => 32768
    }
  }
)
run_list [ "nfs::server" ]

nfs_export resource Usage

Applications or other cookbooks can use the nfs_export resource to add exports:

nfs_export "/exports" do
  network '10.0.0.0/8'
  writeable false
  sync true
  options ['no_root_squash']
end

The default parameters for the nfs_export LWRP are as follows

nfs::default recipe

The default recipe installs and configures the common components for an NFS client, at an effective protocol level of NFSv3. The Chef resource logic for this is in the nfs::_common recipe, with platform-specific conditional defaults set in the default attributes file.

nfs::client4 recipe

Includes the logic from nfs::_common, and also configures and installs the idmap service to provide an effective protocol level of NFSv4. Effectively the same as running both nfs::_common and nfs::_idmap.

nfs::server recipe

The server recipe includes the common client components from nfs::_common. This also configures and installs the platform-specific server services for an effective protocol level of NFSv3.

nfs::server4 recipe

This recipe includes the common client components from nfs::_common. It also configures and installs the platform-specific server services for an effective protocol level of NFSv4. Effectively the same as running nfs::_common and nfs::_idmap and nfs::server.

nfs::undo recipe

Does your freshly kickstarted/preseeded system come with NFS, when you didn't ask for NFS? This recipe inspired by the annoyances cookbook, will run once to remove NFS from the system. Use a knife command to remove NFS components from your system like so.

knife run_list add $NODE nfs::undo

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website