Andreas Paul
2011-Jan-21 12:20 UTC
[Puppet Users] serve static/module and dynamic/template files from a single directory via puppet
Hello there, I''m trying to replace our current sed and rsync configuration management solution and we are used to have static and dynamic configuration files in the same folder. After creating a prototype with puppet I defined the static files as modules and the dynamic files as templates. What I could do to merge these two kind of files is to move the static files in the template folder, but what I would lose is the ability to declare two file sources for that file, e.g. file { "/etc/$name/catalina.policy": [...] source => [ "puppet:///$linie/$name/catalina.policy", "puppet:///default/catalina.policy" ] } so that puppet looks if there is a specific catalina.policy for that project and uses that or, if not, use a default one. Now to my actual questions: Are there any performance or other concerns using templates for static files? Is there a easier way to manage static and dynamic files in one folder? Can I define a template with two source files, so that it uses the general config file, if the specific one doesn''t exist? So what I want is something like that: content => template("$linie/$name/catalina.policy", "default/ catalina.policy") -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2011-Jan-21 17:15 UTC
Re: [Puppet Users] serve static/module and dynamic/template files from a single directory via puppet
On Jan 21, 2011 4:21 AM, "Andreas Paul" <a.paul@enbw.com> wrote:> I''m trying to replace our current sed and rsync configuration > management solution and we are used to have static and dynamic > configuration files in the same folder.[...]> Now to my actual questions: > Are there any performance or other concerns using templates for static > files?The template is always expanded and the content shipped to the client, while file resources can be much more optimized; an identical file should just cost an HTTP request.> Is there a easier way to manage static and dynamic files in one > folder?In my last role I took heavy advantage of the fact that a more specific file resource would override a more generic one. If you define the static files with "recurse" you can also specify files inside that directory with template-generated content that will "win" out priority. We didn''t find many places that didn''t meet our needs.> Can I define a template with two source files, so that it uses the > general config file, if the specific one doesn''t exist? > So what I want is something like that: > content => template("$linie/$name/catalina.policy", "default/ > catalina.policy")No, we don''t have a way to do that; template appends all the files it finds. Regards, Daniel -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.