Anyone have any ideas on adding a default header to puppet managed files and templates? This might be tricky because of the different methods of adding comments for different types of files but I''m certainly open to suggestions that would enforce the existence of a header. -- 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.
On Jun 20, 2010, at 12:37 PM, Psyber wrote:> Anyone have any ideas on adding a default header to puppet managed > files and templates? > This might be tricky because of the different methods of adding > comments for different types of files but I''m certainly open to > suggestions that would enforce the existence of a header.I manage: 1) Config files that use "#" or ";" for comments. 2) Html files that use <!-- --> for comments. 3) Pxe config files that use "#" for comments. 4) Binary files that can''t have comments. The problem is there''s no easy way for puppet to know what format comments are in. There''s no common comment format that will work with all files. "#" comments are the most common, but nowhere near universal. -- 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.
On 2010-06-20 15:37, Psyber wrote:> Anyone have any ideas on adding a default header to puppet managed > files and templates? > This might be tricky because of the different methods of adding > comments for different types of files but I''m certainly open to > suggestions that would enforce the existence of a header. >I''ve been meaning to ask the same question, lately. thanks for asking :) Unfortunately I didn''t look into it yet so I don''t have any suggestion about that. -- Gabriel Filion -- 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.
On 2010-06-20 15:50, Patrick Mohr wrote:> > On Jun 20, 2010, at 12:37 PM, Psyber wrote: > >> Anyone have any ideas on adding a default header to puppet managed >> files and templates? >> This might be tricky because of the different methods of adding >> comments for different types of files but I''m certainly open to >> suggestions that would enforce the existence of a header. > > I manage: > 1) Config files that use "#" or ";" for comments. > 2) Html files that use <!-- --> for comments. > 3) Pxe config files that use "#" for comments. > 4) Binary files that can''t have comments. > > The problem is there''s no easy way for puppet to know what format comments are in. There''s no common comment format that will work with all files. "#" comments are the most common, but nowhere near universal. >Good point there. I wonder if using a module that does "file concatenation" could be a good method. one would need to have a define for each format of header to include and could include a file by calling the appropriate define. I''m not sure but it could make overwriting file resources a lot more complicated... -- Gabriel Filion -- 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.
On 06/20/2010 03:37 PM, Psyber wrote:> Anyone have any ideas on adding a default header to puppet managed > files and templates? > This might be tricky because of the different methods of adding > comments for different types of files but I''m certainly open to > suggestions that would enforce the existence of a header. > >Generally I add in by hand, and I make sure it says whether this is managed as a template or plain file, and what module it can be found in. -- Joe McDonagh Operations Engineer AIM: YoosingYoonickz IRC: joe-mac on freenode "When the going gets weird, the weird turn pro." -- 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.
That is what we do (and we enforce it by convention rather than technically.) # MANAGED BY PUPPET! # /modules/foo/templates/bar.conf # ..any associated warnings, weirdness (eg template called from other module) etc On files that other groups might be touching, we add something like: # Changes WILL BE overwritten every 30 mins! Any permanent changes must be checked # into git under "foo/puppet/". On Mon, Jun 21, 2010 at 10:16 AM, Joe McDonagh <joseph.e.mcdonagh@gmail.com>wrote:> On 06/20/2010 03:37 PM, Psyber wrote: > >> Anyone have any ideas on adding a default header to puppet managed >> files and templates? >> This might be tricky because of the different methods of adding >> comments for different types of files but I''m certainly open to >> suggestions that would enforce the existence of a header. >> >> >> > Generally I add in by hand, and I make sure it says whether this is managed > as a template or plain file, and what module it can be found in. > > > -- > Joe McDonagh > Operations Engineer > AIM: YoosingYoonickz > IRC: joe-mac on freenode > "When the going gets weird, the weird turn pro." > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- 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.
Christopher Johnston
2010-Jun-21 15:01 UTC
Re: [Puppet Users] header for puppet managed files
Similar setup as well: # pwd /etc/puppet/templates # cat header.erb ########################################################################## # # # This file is centrally managed, any manual changes will be OVERWRITTEN # # # ########################################################################## I then use a define called get::template which ensure that the header.erb is applied to every template that is created. On Mon, Jun 21, 2010 at 10:33 AM, Disconnect <dc.disconnect@gmail.com>wrote:> That is what we do (and we enforce it by convention rather than > technically.) > > # MANAGED BY PUPPET! > # /modules/foo/templates/bar.conf > # ..any associated warnings, weirdness (eg template called from other > module) etc > > On files that other groups might be touching, we add something like: > # Changes WILL BE overwritten every 30 mins! Any permanent changes must be > checked > # into git under "foo/puppet/". > > On Mon, Jun 21, 2010 at 10:16 AM, Joe McDonagh < > joseph.e.mcdonagh@gmail.com> wrote: > >> On 06/20/2010 03:37 PM, Psyber wrote: >> >>> Anyone have any ideas on adding a default header to puppet managed >>> files and templates? >>> This might be tricky because of the different methods of adding >>> comments for different types of files but I''m certainly open to >>> suggestions that would enforce the existence of a header. >>> >>> >>> >> Generally I add in by hand, and I make sure it says whether this is >> managed as a template or plain file, and what module it can be found in. >> >> >> -- >> Joe McDonagh >> Operations Engineer >> AIM: YoosingYoonickz >> IRC: joe-mac on freenode >> "When the going gets weird, the weird turn pro." >> >> -- >> 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<puppet-users%2Bunsubscribe@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> >> > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- 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.