Issue #6649 has been updated by Klavs Klavsen.

Thanks for the tip Ben.

It's still very  messy - CentOS f.ex. has a LOT of files in the pam.d folder - 
and I'm currently supporting 3 diff. distro's - which makes for 3 different 
folders - all with a lot of files in them :(

The cleanest for now I decided was to create a define which defines the file, 
and then call it for each folder like this:
pam::tmplfile { ['ldap', 'common-auth', 'common-session', 'ssh', ....]: }

Not optimal - but it works for this limited use - I still have to define which 
files is in the folder - instead of just pointing puppet at the folder, as you 
can usually do if it's "just" files.
----------------------------------------
Feature #6649: template directory
https://projects.puppetlabs.com/issues/6649

Author: Klavs Klavsen
Status: Needs Decision
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Hi,

I find myself wanting a feature so that I could define an entire directory as a 
template'd folder.

ie. so that I simply define something like:
file { "$destfolderpath":
        owner => root,
        group => root,
        mode => 644,
        content => templatedir("pam/pam.d-$lsbdistid.$lsbmajdistrelease"),
    }

and the template function would simply work equivalently to what this would:
file { "$destfolderpath":
        owner => root,
        group => root,
        mode => 644,
        source => "modules/pam/pam.d-$lsbdistid.$lsbmajdistrelease",
    }

Except it would run all files in 
modules/pam/pam.d-$lsbdistid.$lsbmajdistrelease through the template function.

My current use case - would be to manage /etc/pam.d folder with it.
Each distro has different files in the folder - and depending on if I want 
f.ex. ldap, sftp etc. enabled - I would then simply handle this in the file 
using the normal template functions (and basing the decision on wether or not 
to enable f.ex. ldap - on a variable set in the module).

Currently I have to define each file that each distro has.. :(


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to