Automation has always been a passion of mine. I have worked with Microsoft’s Systems Center Configuration Manager (SCCM) in the past for Windows, but over the past few years I’ve wanted a cross-platform configuration tool. My search led me to Chef, and finally within the past month I’ve been able to start reading and learning Chef.

I started my journey to learn Chef at https://learn.chef.io/. The tutorials and documentation is top notch. I was surprised with how quickly I picked up the syntax and structures of a recipe and cookbook. While learning Chef I decided to create a cookbook for configuring the NTPD service.

The cookbook would need to install and configure the NTPD service on a CentOS (or Red Hat) server, and should be fully configurable by an attributes file to make deployment and changes easier. The attributes file must contain all the swithces and configuration options for the service including:

  • Switches for configuring different modes (client, peer server, etc.)
  • Logging options for the NTPD service and time drift logs
  • The NTP Servers to synchronize time against

The default attributes file configures the service to be a standard client and is fully hardened with the Red Hat and NIST standards. I went overboard on the comments, and the attributes file is self-explanatory with a bit of basic NTPD Service knowledge.

As part of the process, I learned a lot about unit testing Ruby, automated build pipeline with Travis CI, Chef’s own food critic for code style, and Vagrant for creating a local virtual test lab. I’ll write more about these components in later blog posts.

You can check out the cookbook in the Super Market: https://supermarket.chef.io/cookbooks/ntpd, or you can pull a copy from my GitHub at: https://github.com/rogerdelph/cookbook-ntpd.

Overall I enjoyed the experience of learning Chef, and highly recommend it. Check out my cookbook and let me know what you think!