Forget Chef and Puppet ! Its Ansible all the way in 2020
Tags: devops, sre
Published: 2020-06-10 17:17:32

This article was originally written as an answer to a question on quora [Why is Ansible Better than Chef and Puppet](https://www.quora.com/Why-is-Ansible-better-than-Chef-and-Puppet).

I started by devops journey back in 2007 with Puppet. Then I picked up Chef around 2010. By late 2012, I had quit my full time job and was running a devops consulting firm, primarily working on Chef, Puppet and AWS. Around 2014 was when I came across Ansible. It was one of my consulting clients who suggested we use this simple new tool for automating their infrastructure, which was primarily on Slackware. I remember asking him why bother about Ansible, when Puppet was very popular tool available in the market for a while, but the client insisted on using Ansible, and so began my journey with it. I not only fell in love with it, but also went to author a book “Ansible Playbook Essentials” which was published in the August of 2015. All of this puts me in the best position to answer this question as I have used all three, and that too at a fairly advanced level.

I am going to divide this answer in to two parts. What makes ansible better, purely in terms of features, as well as in terms of the changing dynamics in the world of software delivery.

What makes Ansible better feature wise ?

Simplicity: To begin with, Ansible is simple. This was the first feature that struck to me when I started learning it. Coming from Puppet, and then Chef, which have a bit of a learning, curve, Ansible was absolutely a breath of fresh air. It is designed with simplicity in mind. Simple to setup, simple to use, simple to write code with (YAML).
Sophistication: Most tools which as simple, also lack features and sophistication. Not Ansible though. The creators of ansible managed to pack in sophistication while still keeping it simple(and there is a story behind it, as Michael DeHaan, creator of ansible had actually worked at Puppet Labs and seen the pain points). So when you need to do complex stuff, its possible.
Agentless : Ansible does not need an agent to be installed on every node it manages. It rather relies on the very reliable, secure, and battle hardened transport technology i.e. ssh. Agentless makes it simple to setup and use. Also no objections from your infosec teams who do not like a agent (puppet/chef) sitting on every machine and running with root privileges. It also makes ansible work on many older devices such as network/storage devices which still support ssh.
Batteries Includes : If you come from the Puppet/Chef world, if you want to connect to a new cloud, storage, networking devices, you have to rely on custom cookbooks, or plugins. Not with Ansible though. Ansible has this large set of modules which are shipped along with the software, which mostly makes it unnecessary to go looking for third party code. Pretty amazing.
Easy to Extend : And when you do not find a module to get your job done, unlike Puppet/Chef, where you need to learn Ruby to extend it, ansible makes it easy too. There have been so many instances that I have taken a existing shell script and wrapped it up as a ansible module. Even though ansible is written in python, it does not ask you to master it. It gives you inputs and expects outputs in certain format. As long as you be mindful of it, you could pretty much write code in any language.
These are some feature comparisons and what makes Ansible better. Now comes the more important part though. The chaning dynamic in the software delivery.

In the last few years, software delivery is being transformed with containers i.e. Docker and Kubernetes. And that is going to be the future trend.
This also means less reliance on Configuration Management Tools e.g. Puppet, Chef, Ansible included.
Most of the application configurations are now managed by containers layers using combination of images and dynamic configuration injection (configmaps, secrets) at the run time
So only thing that you need to bother about when it comes to Configuration Management tools is Systems, Network, Platform configurations.
Ansible is the perfect tool for the job there. Its simple, agentless, and simply makes sense.
Another change in dynamics is RedHat acquiring Ansible. RedHat is the big daddy in the open source world, and has a great influence. Its also doing all the right things (e.g. Ansible, Openshift) etc. They push Ansible big time.
So in essence its not only a fantastic piece of software, it also has a rich father now and its at the right time at the right place !

Well after answering that question, now comes my promotional piece :) …. If you would like to get answers to all of these questions and more, learn about Devops Engineering Blueprint that I have designed to help you master Devops, hop on to my webinar ==> [6 Steps and 3 Secrets to Devops Engineering](http://devops.pink/dwebinar).