Issue #6649 has been updated by Nigel Kersten.
Klavs Klavsen wrote: > problem with augeas is like cfengine - you don't control the entire file, > unless you set it to clear first and then insert.. and it's also rather messy > (in a structure sense) - when you have many files.. On the flip side, you get to express your actual configuration requirements in the DSL, rather than buried in the template. > Using the files as templates (ie. running them through template() - before > putting them on the server) is a very simple (atleast for the other admins > not so comfortable with puppet/programming) way of doing it. >From experience, it gets problematic to maintain too much logic in your >templates. People looking at the manifests aren't aware of what logic is in >the template, and people looking at the templates aren't aware of what logic >is in the manifests. > They can edit the individual files as they'd usually do - and can understand > the simple language used in templates. > > It seems to me, to be a very elegant way - to simply say: > I want this folder propagated - but run each file through template() first. > > Just like you today, conceptually, do for files - by simply replacing source > => with content =>. > > I would love to hear a way to do this, which would also be simple for those > who didn't write it - and which I myself could easily figure out, after 6 > months not having worked with it :) I suggest we post this problem to the puppet-users list and have a discussion there. If we start with some concrete examples of what you need, we can work out whether we really need to implement something like this. ---------------------------------------- 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.
