Puppet

Caching puppet responses for greater scalability

You have put your puppet master behind Passenger and that lasted for some time. But now that you're beginning to have quite a good number of hosts that checkin to your master regularly, performance has started to become an issue. What can be done about it?

There are multiple answers. The first and simplest would be to put more space between your puppet runs. Say you're currently running puppet every 30mins on each client, you could change that period to 45mins or 1h.

It's also possible to distribute runs via a central scheduler that would ensure to run every node before going back to square one. One such solutions is the "puppetcommander.rb" script that R.I. Pienaar wrote to use mcollective as the run scheduler.

Another method (that you can use in conjunction with the above) is to cache the responses that come from the puppet master.

Wait.. what happened to my file? ... oh ... the puppet master blew out my changes.

A friend of mine found out an interesting plugin for those admins out there that use ViM. It makes it easier for you (and your colleages) to see when you are editing a file that is managed by puppet:

http://blog.mricon.com/2012/04/puppet-eyes.html

This module will only work when your editor has root privileges, since the file it parses, state.yaml, is accessible only to root (for relatively evident reasons). When you try to modify a file that is currently managed by puppet, you will see a white on red warning telling you "This file is managed by Puppet":

puppet-views warns you out when you open a file that is managed by puppet

Tags:

Iterating through all IP addresses in a puppet ERB template

Sometimes, it's relevant to iterate through all ip adrresses on a host to emit configuration for each one. Facter has a useful bunch of facts for this:

  • interfaces => lo,eth0,eth0_0,eth1
  • ipaddress_lo => 127.0.0.1
  • ipaddress_eth0 => 192.168.0.200
  • ipaddress_...
  • ... and so on

This is nice, but how can you use this in an ERB template?

How do you place files on a puppet master?

Example file hierarchy on a puppet master

There are a bunch of best practices that can be followed to make your life easier with Puppet. The above diagram (full size available here)is a visual representation of how I place files on a puppet master to follow a couple of best practices that I've found interesting.

Here's a quick list of points that I follow when placing files on a puppet master

mini-itx board for fun and routing

Mini-box case with Atom-based board
The back plate installed in the case
The interior and a disk.

Like I mentioned in my post about hard disk noises, I recently bought a mini-itx board and built a really small computer.

The intent was to replace my more than 7 years-old desktop computer that was begining to misbehave, and to have the new thing replace my linksys router's DNS and DHCP services. The computer that I had before was mainly used as an Asterisk server and also as my SSH portal, and backups were pushed to an external usb disk plugged to it. The new one, I thought, should be doing all the same, plus host the services I mentioned above. The best thing would be for it to replace entirely the linksys router... but that would be for a second phase.

Subscribe to RSS - Puppet