Al @ Lab42: > You can build a file based on different "fragments" at least in 2 ways: > - When you specify an array of templates , when using the content => > argument, these templates are actually appended in the defined order. > - With the puppet-concat module by Rip > https://github.com/ripienaar/puppet-concat you can build up files > based on different fragments (and you can define single fragments as > exported resources so that they fit the need you expressed).
I recently adopted puppet-concat, and found it my new big hammer for almost everything. I had previously set up a define for a simple header/body/footer structure where only those who cared would supply a custom body template name as an argument. When it came time to add more smarts, it was trivial to swap out the file resource in the define and insert both a concat and a concat::fragment. I now still have the old three-template API as well as a "provide any fragments you like, but know that the header/body/footer have order 01/50/99" mechanism available. One could also use Augeas, but I do not feel that it would fit the original poster's desire to find a strong and helpful standard. Augeas doesn't do well when you need to assert the state of a file overall (which is at the heart of puppet's declarative nature) but with responsibility divided among systems. It does much better when you need to surgically assert one or two lines or stanzas in an otherwise unmanaged file. I'll just say that Augeas is named after a man who let his stables fill up with so much crap that Hercules had to divert two whole rivers to pressure-hose it clean again. You can't make this stuff up. -- "These people program the way Victorians dress. It takes two hours and three assistants to put on your clothes, and you have to change before dinner. But everything is modular." -- Miles Nordin, on PAM -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.