I'm relatively new to Puppet and have recently inherited a very large infrastructure (Puppet 3.6 on a number of RHEL 6 machines).

My Puppet infrastructure looks a bit like this:

I have my_module::mysql, which and installs and configures MySQL (based on parameters passed to it from Dashboard or other classes that include it). Among many other things, it sets the location of the log files. (There are a number of other classes like this, and sometimes this class may be called a few different ways on the same node.)

I now have my_module::flume, which installs and configures Apache Flume so I can ship some logs elsewhere.

My problem: I need my_module::flume to know where every instance of my_module::mysql put its logfiles, so it can add those to the Flume configuration file.

What is the best way to do this? I think I want to be able to add to some sort of resource (a global variable or a file) that each class can add a file path to, so my_module::flume can iterate through the list and add each path to a config file, but I'm not sure how to do that while still ensuring that:

-The list of logfiles is started over every time Puppet runs (so, for instance, log files that no longer exist are not still in the list.)

-The Flume class is evaluated only after all the other classes have added the paths to the list.

Any input would be appreciated.


You should

  1. Manage the config file using a concat module.
  2. Make each instances of my_module::mysql create a virtual concat snippet
  3. Have my_module::flume realize all those virtual snippets

This might well be sufficient to solve the whole problem.

  • Thanks! I wound up doing something similar, but by creating a facter fact to read the concat file instead of having my module do it itself; this would've been cleaner, so I'll do that sometime. – mlb2101 Sep 2 '15 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.