On Monday, May 6, 2013 10:06:20 AM UTC-5, Schofield wrote: > > Indeed, templates and Concat, either individually or in combination, are >> great tools for managing files, including where responsibility for >> different pieces of the file is spread across multiple classes. >> > > This is exactly my situation. I need multiple other modules to contribute > multiple lines to the file. > > >> Unfortunately, none of that is really analogous to Stdlib::File_line, >> which manages *just* one line in a file, without managing the rest of >> the file's content. That's a pretty strange thing to do in the Puppet >> scheme of things, actually, but I suppose it can be useful. >> >> I am not aware of any existing, publicly available module providing a >> type that manages blocks of lines in a manner analogous to >> Stdlib::File_line. There are several possible approaches that might work >> instead, depending on the details of the problem, among them: >> >> - Manage the whole file (best, if it is feasible). Templates and/or >> Concat fit right into this. >> >> I would like to use templates if possible but what I have not figured out > yet is how to provide the lines from different modules during the catalog > compile. Is it possible to send the lines from multiple modules to another > and guarantee that the module managing the file has received all the > lines? My understanding is that puppet does not guarantee ordering during > the catalog compile. > >> >>
It sounds like the Concat module may be just what you're looking for, provided that amongst all the relevant classes you are ultimately managing the entire file. Compilation order is not relevant here, as it has no effect on the order in which fragments might be assembled into the final file, but Concat does provide means to control the relative order of the fragments. Here's the module URL on the Forge: https://forge.puppetlabs.com/ripienaar/concat. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
