O'Reilly logo

Puppet 5 Cookbook - Fourth Edition by Thomas Uphill

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The nfs::exports class defines an exec, which runs exportfs -a, to export all filesystems defined in /etc/exports. Next, we define a concat resource to contain concat::fragments, which we will define next in our nfs::export class. concat resources specify the file that the fragments are to be placed into; /etc/exports in this case. Our concat resource has a notify for the previous exec. This has the effect that whenever /etc/ exports is updated, we run exportfs -a again to export the new entries:

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

We then created an nfs::export ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required