NFS (Network filesystem) is a protocol to mount a shared directory from a remote server. For example, a pool of web servers might all mount the same NFS share to serve static assets, such as images and style sheets. Although NFS is generally slower and less secure than local storage or a clustered filesystem, the ease with which it can be used makes it a common choice in data centers. We'll use our myfw
module from before to ensure that the local firewall permits nfs
communication. We'll also use the puppetlabs-concat
module to edit the list of exported filesystems on our NFS server.
In this example, we'll configure an nfs
server to share (export) a filesystem via NFS:
- Create an
nfs
module with the followingnfs::exports
class, which defines aconcat
resource:
class nfs::exports { exec {'nfs::exportfs': command => 'exportfs -a', refreshonly => true, path => '/usr/bin:/bin:/sbin:/usr/sbin', } concat {'/etc...