In this example, we'll configure an nfs server to share (export) a filesystem via NFS:
- Create an nfs module with the following nfs::exports class, which defines a concat resource:
class nfs::exports { exec {'nfs::exportfs': command => 'exportfs -a', refreshonly => true, path => '/usr/bin:/bin:/sbin:/usr/sbin',} concat {'/etc/exports': notify => Exec['nfs::exportfs'], }}
- Create the nfs::export defined type. We'll use this definition for any NFS exports we create:
define nfs::export ( String $where = $title, String $who = '*', String $options = 'async,ro', String $mount_options = 'defaults', String $tag = 'nfs') { # make sure the directory exists # export the entry locally, then export a resource to be picked up later.