On Mon, Dec 17, 2012 at 10:47:36PM -0800, Roman Shaposhnik wrote:
> On Mon, Dec 17, 2012 at 6:46 AM, Nikola Petrov <[email protected]> wrote:
> > You have a bunch of options for this if I understand you well. You can
> > one of the following:
> >
> > * use augeas with virtual resources
> > * use the concat module
>
> Understood. I'm leaning heavily towards augeas at this point
> (although I'm a bit scared of throwing various XML at it).
>
> If stock augeas doesn't pan out I think I'm going to
> go with the most basic solution of all -- having a template
> with easy markers and doing a bunch of exec's of sed -i
> (wrapped in a nice custom resource of course ;-)).
>
> > * use the standard template function with multiple arguments; look at
> > http://docs.puppetlabs.com/guides/templating.html and scroll down to
> > "Combining templates"
>
> You lost me there -- would you mind elaborating how these
> type of 'Combining templates' could be useful in my case?
I hope that I understood you correctly in the first place - otherwise
ignore my advice :). You want to aggregate a common configuration file
for *all* of your services so you want one of the following:
* combine all config files to look them in one place - this is easily
done with templates if you have a bunch of service classes
class service1(...) {...}
class service2(...) {...}
each of these has a template for it's configuration(with params and what
not). You then just call the template function with all of them and they
will be concatenated. In the case of the XML you might get clever and
include a pre and post templates to get a proper tree
* you want to provide a common config file for sane defaults and then
override some of the settings in each service. This can be done again
with templates - it is a bit harder and it might be slower for your
taste but it is still doable - you define some kind of virtual resource
for sub templates and then realize only those that you see fit.
Note that both are almost the same(if not the same) as the concat
plugin. So you might just better use the already working implementation
from there.
--
Nikola
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" 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-users?hl=en.