Running external Ruby code from Vagrant

The Story

Like a lot of Chef users, I'm using Vagrant for testing my cookbooks. I'm also using Berkshelf for providing the Vagrant box with the cookbooks it needs.
Until recently, I was happy using the ChefDK-provided Berlshelf (v4.0.1). I stopped being happy when running berks ...

more ...


Chef Custom Resources - Missing Documentation

The new Chef documentation for Custom Resources is pretty lackluster.
This is probably because they're too busy making awesome stuff, but I still needed to learn some stuff the hard way.
Thought I'd share them.

The basics

There is no longer a "state-only" resource and an implementing provider ...

more ...

Parsing AWS billing

The Story

I never understood the AWS billing very well and happily left it to my CTO.
A couple of days ago, however, my CTO secretly told me he's mainly interested in learning 2 things from those bills:

  1. How much are we paying for every component of the application ...
more ...

Managing Jenkins API Tokens

The problem

Api Tokens are like user passwords, except they are always managed by Jenkins (even if you're using an external authentication scheme), and can only be used for "API" actions (e.g. using curl).
The storage scheme of these tokens is a little weird - the stored value is ...

more ...

Open-Gridview - the FOSS Out-Gridview

The Story

I've been a Microsoft SysAdmin for a long time before switching for Linux. During which, I scripted a lot in PowerShell.
PowerShell has several "output" functions like Out-File (which passes the input to a file), Out-Null etc.
One of these functions was Out-Gridview which tabularizes its input ...

more ...

Using a global lock in Chef

The Story

Our dev team is currently using a Snowflake-like ID generation scheme that looks like this:
snowflake diagram
(Diagram by Elad Rosenhim, architect and companion at Dynamic Yield. See his post about distributed keys and how to survive managing an HBase cluster)

Those familiar with MongoDB might notice this structure ...

more ...

Enhancing Packer Templates with eRuby

The Problem

Packer is a great tool for creating machine images, and I'm using it to create EC2 AMIs.
My issue with it is that Packer is using JSON for input, and JSON is very inflexible. For instance, you can't:

  • Write comments (there was an issue open for ...
more ...

Listing Chef Cookbook Licenses

As part of a compliance check for our company, I was required to print the name/version of all FOSS proejcts I'm using.
Most of it was digging around Gemfiles and setup.pys, which isn't that interesting. The neat part was this snippet to extract license ...

more ...