I'll list current limitations but first, the code define nfs::export ( $client, $share_owner = "root", $share_group = "root", $share_mode = 755 ) {
# Install package, ensure /etc/exports, manage nfs service..... include nfs::server file { $name: ensure => directory, owner => $share_owner, group => $share_group, mode => $share_mode, } augeas { "$name": context => "/files", require => File["/etc/exports"], changes => [ "set /etc/exports/dir[10000] $name", "set /etc/exports/dir[last()]/client $client", "set /etc/exports/dir[last()]/client/option rw", ], # onlyif => "match /files/etc/exports/dir $name", } } Example use: node dumbo { nfs::export { "/foo": client => "bar.example.com", } nfs::export { "/bar": client => "foo.example.com", } } Current limitations and problems 1. Client options are hard-coded. Not sure I can devise an approach that would allow something cool like nfs::export ( "/foo": client=> "bar.example.com", options => [ "rw", "sync" ], } 2. Only configures 1 client per share. This sucks. 3. The "onlyif" should prevent duplicates. It is commented out while I try to figure out how to do this correctly. Needless to say, feel free to contribute ideas and/or improvements :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---