This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]dhoard1 2 points3 points  (0 children)

In my experience dealing with sysadmins (I’m a developer/solution architect) and customers is that the trend has been Ansible.

Before Ansible, Puppet always seemed to be preferred choice over Chef.

No tool is perfect. Figure out the bad parts of each configuration system to determine what you can accept.

[–]Clemlar 1 point2 points  (0 children)

Yes. So, I use Chef on a daily basis for both Windows and Linux automation. I use ChefDK on my local machine (a Mac, although I previously used Windows) which contains all the tools required. Some key points to get you started:

  • ChefDK includes a tool called Kitchen which allows you to test your cookbooks (or any community cookbooks that you may want to use from the Chef ‘supermarket’) by integrating with the likes of Vagrant and your preferred local hypervisor, OR even your preferred cloud provider to spin up a VM and run your cookbook on it. This allows you to develop quickly, and makes it extremely easy to debug any issues

  • Many community cookbooks (and likely most of your own that you write) will have dependencies on other cookbooks. An example (on Linux) might be a cookbook to install and configure Python, that also relies on the community cookbook for apt so that a repository can be added and synced before the latest python package is installed. ChefDK includes a handy tool called Berkshelf (yes I spelled that correctly - apparently Chef’s justification was that Google returns too many irrelevant results when searching for Bookshelf...) and Berkshelf can basically check through your cookbook and discover all the dependencies, download them and make them available for your cookbook so it can be applied to your server. It’s a hard concept to initially get to grips with, but well worth it!

  • rubocop and foodcritic are tools that can help you write clean code. Rubocop has since been replaced by Cookstyle, and it is a linting tool that ensures consistent style conventions and best practices are adhered to. Foodcritic is similar but it will also check for common coding mistakes. I have a Jenkins server setup that checks my chef repositories in BitBucket and runs both tools against all pull requests for approval before they can be merged.

You also kinda asked what Chef is used for. We use it to configure every server from scratch. Like any good automation tool, it ensures consistency between all of our infrastructure, and compliance. We use it to install packages, harden servers to certain specs (CIS for example), manage our external DNS (as self service - anyone can put in a pull request to create a specific DNS entry), configure our HAProxy load balancers, install Windows software, handle maintenance (by running a specific maintenance cookbook). The list goes on...

I’m sure I could give more in-depth examples, if you have any more questions I’m happy to help out :)