Issue #6649 has been updated by Nigel Kersten.

Assignee set to Nigel Kersten

How would the mapping from a given template name to a given file work? You just 
wouldn't call them .erb files, but you'd want them to be templated?

I'm always worried when I see people using templates this heavily. It's 
generally not the best way to do things.

If you need lots of conditional logic in your pam.d/ files, I'd suggest you 
should look at wrapping the Augeas type with your common settings for 
inserting/removing lines, and do the actual conditional logic in your manifests.

If you're comfortable setting the entire contents of the files (which you are 
anyway given you're templating them), can you just build up that logic in 
Puppet itself?

This really feels like a problematic feature to implement, and that there are 
almost certainly better ways to achieve what you want.



----------------------------------------
Feature #6649: template directory
https://projects.puppetlabs.com/issues/6649

Author: Klavs Klavsen
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
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:
<pre>
file { "$destfolderpath":
        owner => root,
        group => root,
        mode => 644,
        content => templatedir("pam/pam.d-$lsbdistid.$lsbmajdistrelease"),
    }
</pre>
and the template function would simply work equivalently to what this would:
<pre>
file { "$destfolderpath":
        owner => root,
        group => root,
        mode => 644,
        source => "modules/pam/pam.d-$lsbdistid.$lsbmajdistrelease",
    }
</pre>
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