Skip to content

Instantly share code, notes, and snippets.

@alecl
alecl / Chef_what_are_all_these_file_files.md
Last active Sep 21, 2015
Quick notes on various configuration management files that end in the word file
View Chef_what_are_all_these_file_files.md

Nice overview of most of these file types and more in this great overview blog entry.

Gemfile (Ruby) - is used to manage installation and dependencies for Ruby gems. It's read and processed by bundler.

Berksfile is used to manage installation and dependencies for cookbooks (much like Gemfile manages gems).

Guardfile is used to describe how to watch files and folders and execute commands automatically if they change. Often it's used to run some of the automated linting and testing commands like rubocop, foodcritic, chefspec/rspec.

Thorfile (Ruby) is a command line helper description file that provides documentation and hints on what command line parameters are expected by certain commands.

@alecl
alecl / Chef_test_kitchen_getting_started.md
Last active Apr 11, 2017 — forked from lamont-granquist/getting_started.md
Forked and adjusted notes for creating a sample cookbook and running it through test kitchen with docker.
View Chef_test_kitchen_getting_started.md

ChefDK, Test Kitchen Driven NTP Cookbook via Docker

This gist is a fork from lamont-granquist modified to be even easier and faster by taking advantage of Docker. Given the rapid development and change rate of Chef finding this gist with instructions that still are valid and reasonable was much appreciated.

This gist uses TK+Berkshelf to drive creating a vagrant virts and converging a simple recipe to install and configure NTPd. This is a simple cookbook that has one recipe, one template (for ntp.conf) and one attribute file. It works on Ubuntu 12.04/14.04 and CentOS 6.4/7.1 (and derviatives) and the attribute file is used to support both distros.

This should work on Mac (where I developed it) and any chef-supported Linux that you can get Docker onto (Ubuntu/CentOS).

Because I use ChefDK and Test Kitchen, I can largely ignore setting up Docker and Berkshelf and can get right to work on writing recipe code.