A Configuration Management Rosetta Stone: Configuring Sensu with Puppet, Chef, Ansible and Salt

I recently finished my Intermediate Sensu Training on Udemy. It was a ton of work but I’m glad I got it all together. Part of that training includes how to deploy and configure Sensu with four of the most popular open-source configuration management tools: Puppet, Chef, Ansible, and Salt. TOC {:toc} The Sensu Decree In order to do the training I had to learn each of these tools enough so I could install a baseline Sensu installation.

Getting Started Puppet Acceptance Tests With Beaker

Beaker is a test framework created by Puppetlabs to run tests against puppet modules on real servers (vm, containers whatever) and test that they do what they say they should do. This is a quick tutorial on how to use this framework. At the time of this writing, Beaker is under heavy development, so this could all change. The Gem The first thing you need to do is install beaker.

Managing Ssh Known Hosts With-Serf

Serf is a very interesting service discovery mechanism. Its dynamic membership and tags capability make it very flexible. Can we use it to generate a centralized ssh_known_hosts file? Installing and Configuring Serf I like to use configuration management to manage servers. Here I use a Puppet module to install and configure Serf: class { 'serf': config_hash => { 'node_name' => $::fqdn, 'tags' => { 'sshrsakey' => $::sshrsakey }, 'discover' => 'cluster', } } This particular module uses a hash to translate directly into the config.

What Happens When You Run Puppet Tests

Breaking down bundle exec rake spec What is happening when you run: bundle exec rake spec Bundle The first command you are running is bundle. Bundle is kinda like virtualenv for Ruby. It makes sure that you use the same ruby libraries that you, everyone, and puppetmasters use. Bundle uses a Gemfile, and searches downwards. As long as you have the Gemfile in the puppet repo, it will work.

Writing Purgable Puppet Code

Whenever possible, I try to write Puppet code that is purgable and “Comment Safe”. That is not a very good description. What I mean is, Puppet code that removes resources from a system when the corresponding Puppet code is “Commented” out of a manifest. Lets look at a few examples. Example: Managed Sudo Lets say you used this popular sudo module with the following params: class { 'sudo': purge => true, } Great start.

Sensu Reports in your Motd with Puppet!

Intro Sensu is a pretty cool monitoring framework. The authors designed it to be configured by a configuration management system from the beginning. Check out how easily I can make it put a report in my motd with a little bit of python and puppet. The Report Script Sensu’s API is super easy to work with. For this I will be using the Events endpoint. Here is a quick script to get the events for a host (gist):

Managing DNS Automatically with Puppet

Why So you have a decent amount of things configured in Puppet. Great! Are you finding that you have to manually update your DNS entries when things change, like when new hosts or added, or additional services are created? Why? Your DNS zone files will forever be out of date, waiting for humans to update them. Just say no. Puppet already knows what the ip addresses and hostnames of your servers, why not take advantage of that existing data?

Getting Started With Sensu Using Puppet. For Real.

Nagios. So familiar. I feel like I’ve run Nagios at every job I have ever had. Talk to most ops people, even at really big places, and they will probably admit to using it. Puppet’s exported resources takes away some of the pain, but sometimes I think to myself, there must be a better way to do this. Sensu might be that better way. Let’s try it out, but gosh, I am SO lazy.

Dropbear with Mosh on a Low End Server

I love my low end boxes. I also love mosh. Low end boxes usually are tight on resources, so Dropbear is often used as a lightweight ssh server. Mosh is mostly tested with openssh-client/server, so I think there are some bugs. But it can work, just make sure: You are using the same version of mosh on the server as you are on your client. (otherwise they may not support the same command line options)

Goodbye Intel - My Favorite Commands

Working at Intel has been a great experience. I wish I could have stayed longer, but in the end we decided to part ways. During my stay I learned lots of stuff. I would like to boil my experience down to my top Linux commands. The List git: Lots of git. syscfg: Managing bios settings from within Linux. Nice. (Intel platforms) setupbios: More bios settings from within Linux. (Dell platforms) puppet: I actually enjoy manually running puppet.