0

For Puppet clients to report results back to the master server, "report = true" needs to be in the "[agent]" section of the client's puppet.conf. But how can I get Puppet to enforce that?

It's disabled by default, but all the resources I can find online seem to suggest doing it manually as if it's no big deal. Maybe it isn't, but isn't automating/enforcing basic server configuration exactly what Puppet is intended to do?

I'm new to Puppet, but this seems like a common and trivial task that I can't seem to find a solution for. Is there something I'm misunderstanding? Or is this really an uncommon/difficult task?

Moduspwnens
  • 747
  • 1
  • 7
  • 18
  • You're using puppet, aren't you? Serve the machines your own `puppet.conf` and have the puppet agent service subscribed to the file. – Michael Hampton May 01 '13 at 19:56
  • Is that going to be safe across operating systems, though? There are a lot of other things declared in puppet.conf that look like they'd vary. – Moduspwnens May 01 '13 at 20:00
  • Create a fact which identifies the OS and then have your template reference that fact to replace appropriate parameters per OS, or just have a different file served based on the OS. – Doug May 01 '13 at 20:42
  • I guess that'd work, but then I'd have to keep track of what all the defaults are for each OS and update those as they change with new releases. That just seems over-the-top unnecessary for something that is apparently pretty typical--even more so considering the purpose of the software. – Moduspwnens May 01 '13 at 22:35
  • 2
    Differences amongst operating systems are gracefully handled using [hierarchical data](http://docs.puppetlabs.com/hiera/1/index.html). Create a hiera data structure based on the `operatingsystem` fact, or use custom facts under `/etc/facter/facts.d` if you need to. – dawud May 01 '13 at 23:06
  • Right, but that'd still put me on the hook to keep track of the defaults for each OS / version, and would potentially break things or introduce problems if those defaults changed (or more were added) in future versions. All I really want is to make sure that "report = true" is in the "[agent]" section, so I may be able to do that with fairly basic Ruby. I'm just really surprised/confused that I seem to be the first person wanting to do this. – Moduspwnens May 02 '13 at 13:55

1 Answers1

0

The inifile module will let you specify just a single line in your puppet.conf file. You might still need some additional OS-based rules to get the full path to that file, but that should be easier than managing all of your defaults all the time.

asciiphil
  • 3,086
  • 3
  • 28
  • 53