Sounds like a job for https://github.com/dalen/puppet-puppetdbquery
potentially? pdbresourcequery or maybe even the hiera backend.


On Tuesday, September 9, 2014 11:49:21 PM UTC+1, mpou...@afilias.info wrote:

I have a difficult-to-manage application which does not implement a conf.d
or include syntax in its configuration, but requires a bunch of config
snippets that contain information only on groups of other servers. I've
been dealing with this by generating the config snippets from templates on
some servers as exported resources, realizing them on the central server,
and then executing an external script to "compile" these snippets into the
final config.

This has a couple of drawbacks. First, it requires puppet to stat nearly
15,000 little tiny config snippets every run that are not actually used
directly, and shouldn't need to exist. Second, the final config file,
because it's compiled by an external script, isn't under the control of
puppet, so it has no idea if that file gets modified by something outside..
so it can't know to update it.

I've been mulling over a better way to manage this config file, and I
think I've hit on an idea, but I have no idea if it will actually work, or
what the syntax would look like if it could.

I'm thinking of replacing the @@file resources on the remote servers with
a defined type .. say .. @@data_container. Then, on the server where the
data is needed I could use a collector to iterate over the exported
resources reading data from them to use in the single template for the
final config file.

Where the data is defined:
@@data_container { 'mydata':
someparameter => 'foo'

And then in the template on the other host, somehow get a collection of
those resources into an array, and make use of their parameters as
variables to be referenced in the template..

<%- collection.each do |data| -%>
<%= data.someparameter %>
<%- end -%>

Would this work at all? Is there syntax to support something like this?

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 puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/59ba639d-441a-41f9-bcf4-93ac45fe209f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 8 | next ›
Discussion Overview
grouppuppet-users @
postedSep 9, '14 at 10:49p
activeSep 15, '14 at 2:26p



site design / logo © 2022 Grokbase