ghoneycutt / puppet-module-nfs

Puppet module to manage NFS
Other
4 stars 30 forks source link

create define - nfs::export #1

Closed ghoneycutt closed 7 years ago

ghoneycutt commented 11 years ago

We need a define that ensures entries in /etc/exports

something like

define nfs::export (
  $local_path,
  $remotes,
  $options = 'ro',
) {
 ...
}

You could then write the nfs::export info as a hash and use create_resources()

see examples at

https://github.com/ghoneycutt/puppet-module-common/blob/master/manifests/init.pp#L365

http://docs.puppetlabs.com/references/latest/function.html#createresources

ghoneycutt commented 11 years ago

@noppe is taking this on

Wildcarde commented 10 years ago

Was this ever completed? Would it be easier to make this a simple erb template where the hashes are used to generate a line each?

ghoneycutt commented 10 years ago

@Wildcarde would prefer to use the method originally listed because it still allows you to specify exports as a hash, but gives you the added benefit of being able to validate each of the parameters. We want to validate the params in the manifest instead of the ERB, so that we can fail() the compilation of the catalog if needed.

Wildcarde commented 10 years ago

That's fair, have you looked into using the export.d directory to handle writing exports out instead of what would presumably be an augeus implemented resource?

ghoneycutt commented 10 years ago

I have not as I do not think it is very portable, since this module supports a bunch of OS's. We could use file_line from stdlib though.

ghoneycutt commented 7 years ago

Decided to use file_line instead as of V2 in PR #78