ghoneycutt / puppet-module-nfs

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

Added new exports manifests and a define off of this to generate the … #65

Closed vamegh closed 8 years ago

vamegh commented 8 years ago

…exports file for nfs server exports, along with appropriate templates for this.

new file:   manifests/exports.pp
new file:   manifests/exports_data.pp
modified:   manifests/server.pp
new file:   templates/exports_body.epp
new file:   templates/exports_header.epp
ghoneycutt commented 8 years ago

Hi @vamegh

Thanks for sending code. Everyone I know using this has dedicated devices like NetApp's to serve the NFS exports so I really appreciate you looking at managing the exports in a more dynamic format. Comments are inline with the code.

ghoneycutt commented 8 years ago

We also need the new define to be documented including all of its parameters and to have comprehensive spec tests.

vamegh commented 8 years ago

Hi Garett,

This is just something for you to use if you want, or if some one else wants for puppet 4. I have just added it to make life easier -- exports.pp can be merged with server.pp, I kept them separate initially to not mess with your original manifests, which I ended up modifying anyway to call it.

$name and $title are essentially the same, however in puppet docs, it states the following:


Every defined type gets two “free” parameters, which are always available
and do not have to be explicitly added to the definition:

$title is always set to the title of the instance. Since it is guaranteed
to be unique for each instance, it is useful when making sure that
contained resources are unique. (See “Resource Uniqueness” below.)
$name defaults to the value of $title, but users can optionally specify a
different value when they declare an instance. This is only useful for
mimicking the behavior of a resource with a namevar, which is usually
unnecessary. If you are wondering whether to use $name or $title, use
$title.
https://docs.puppetlabs.com/puppet/latest/reference/lang_defined_types.html

just as an FYI.

Again the banner message, it just provides choice to manage the banner in hiera.

You can make the options into an array, but you can just pass along all of the parameters as a string (I did this really quickly)

I hacked this together in about an hour to test something we were working on in aws, we are not even using this, but I thought it might save you some time, since you had it commented as a to-do. I've tested it on puppet4 and it generates the file correctly.

If I get time I'll come back and convert it to an erb and change some of the stuff you mentioned above, but if you want just grab it and do whatever you want with it, if it'll save you some time.

Kind Regards,

-v

On 16 December 2015 at 16:42, Garrett Honeycutt notifications@github.com wrote:

We also need the new define to be documented including all of its parameters and to have comprehensive spec tests.

— Reply to this email directly or view it on GitHub https://github.com/ghoneycutt/puppet-module-nfs/pull/65#issuecomment-165169583 .

vamegh commented 8 years ago

Hey,

most of the stuff you wanted changed done.

-v