Ansible and chef are configuration administration (CM) instruments that assist sysadmins and DevOps professionals handle a lot of servers. They excel at repetitive job automation, simultaneous deployment of apps and packages to a gaggle of servers or configuration and provisioning of recent servers from scratch.
Ansible vs Chef Infographic
What’s Ansible?
Ansible was launched in 2012 by its mother or father firm AnsibleWorks and has since gained a devoted following.
Ansible is written in Python and solely requires the Python libraries to be current on the servers to be configured, the default on virtually all Linux distros.
Ansible’s distinctive promoting factors are its light-weight, relative ease of use and velocity of deployment in comparison with different CM instruments.
In distinction to Chef, you need not be taught Ruby to make use of Ansible. It is because Ansible packages all instructions into YAML modules referred to as playbooks.
This implies so long as your most well-liked language can output JSON modules, you should use Ansible.
Ansible additionally does away with brokers, all master-agent communication is deal with by customary SSH instructions or the Paramiko module that gives a Python interface for SSH2.
It is a nice added bonus as a consequence of SSH’s in-built safety.
What’s Chef?
Chef was launched in 2009. It’s supported by mother or father sponsor OpsCode. It’s continuously in contrast and contrasted to different old-timer CM instruments like Puppet. Like Puppet, Chef is written within the Ruby programming language and its CLI makes use of a Ruby-based DSL. The software program might be run on a client-server or in a standalone referred to as Chef-solo.
Chef makes use of a master-agent mannequin and a grasp server. This implies a Chef set up requires a workstation to management the grasp. Brokers are put in from the workstation utilizing the knife device that makes use of SSH for deployment. From there, managed nodes authenticate with the grasp by certificates.
Chef brokers have to be configured to verify in with the grasp periodically and instantaneous master-to-agent rollout adjustments aren’t but potential.
Chef configs are packaged into JSON information referred to as recipes.
Ansible vs Chef: The place Ansible Wins
Ansible is an easier strategy to the configuration administration work. It avoids the grasp and minions strategy utilized by different open supply configuration administration instruments like Chef.
Reasonably than organising a client-server set up, Ansible makes use of an agentless structure. It is a totally different strategy Chef, which has one Chef server and quite a few Chef-client situations.
Ansible manages distant connections by way of SSH networking utilizing implementations resembling OpenSSH. SSH is extensively supported throughout cloud platforms together with AWS, Google Cloud and Microsoft Azure.
This leads to quicker deployments and reduces the complexity of configuration information.
For enterprises, Ansible Tower a premium product that has a web-based API and graphical stock administration device. Ansible Tower provides a user-friendly central dashboard the place you’ll be able to see the standing of your servers, handle entry management and monitor job runs.
Moreover the decrease studying curve, Ansible is nearer to the naked steel working system on the distant server. In contrast to CHef the place it’s essential perceive Ruby area particular language (DSL), Ansible runs effective from the command line with instructions you might be aware of. Alongside its easy YAML format for its playbooks.
This implies your instructions are simpler to purpose with and the efficiency on the machine is quick.
Deploying by way of VM photographs like VMWare or containerization by way of Docker is frequent for making constant environments simpler for DevOps engineers.
Ansible requires no shopper set up, eliminating one other efficiency penalty out of your utility deployment setup. In case your workforce is new to DevOps instruments, Ansible can cowl most use circumstances with out drowning the workforce in a sea of advanced orchestration.
Ansible additionally safeguards your DevOps workforce from configuration drift by idempotent configuration administration.
Ansible permits you to preserve the state of your servers constant sooner or later by working Ansible playbooks primarily based on Ansible’s stock replace coverage.
On future executions of a playbook, Ansible begins by “Gathering Facts” to establish when a specified change was carried out in an earlier run of the playbook.
This ensures, for instance, if a specified OS consumer or say, Github distant was already added, it will not be added once more sooner or later if you rerun the playbook.
State adjustments are solely executed if the specified state laid out in your playbook isn’t met.
With its minimalist design, idempotency, and sticking as shut as potential to pure SSH, Ansible wins out in order for you the least intrusive deployment, orchestration, and configuration administration workflow.
Ansible vs Chef: The place Chef Wins
The unique use case for Chef at OpsCode after they launched their automation device in 2009. Regardless of the efficiency advantages and decrease studying curve of Ansible, there are use circumstances the place Chef is not only justifiable however preferable.
Chef’s Ruby DSL is an actual pleasure to work with for groups composed of a mixture of DevOps engineers and software program builders who use Ruby for the majority of their work.
DevOps engineers aware of the Ruby and different crucial languages resembling Python, C++ and Java will probably be at residence with Chef.
Whereas Ansible and YAML are straightforward to choose up, the declarative paradigm is step faraway from on a regular basis crucial coding with Ruby, which is what Chef replicates effectively.
As Ansible is “just SHH”, Chef is “just another Ruby DSL” so it affords little in the best way of limitations to entry for a well-versed Rubyist.
The opposite large benefit for Chef is its flexibility. That is because of the distinctive energy of the DSL that composes Chef recipes and cookbooks, together with embedded Ruby (ERB) templates that present superior customization for varied configuration information.
In case you have a posh cloud deployment throughout platforms resembling Amazon EC2, Google Cloud, Azure and OpenStack with common schedules for server updates, Chef is a good choice.
The newest Chef open supply model 15.3.14 was launched on September 12 2019 and is offered free of charge.
There may be enterprise supported Chef Infra, Chef Examine, Chef Habitat and Chef Automate. Plans for these look as follows for 100-500 nodes:
Easy Infrastructure: $16,500/12 months for the “Essentials” plan, which matches as much as 100 nodes, and $75,000/12 months for the “Enterprise” choice, which matches to 500 nodes and offers Premium Assist.Enterprise Automation Stack: the “Essentials” plan prices $35,000/12 months, with Commonplace Assist, aspect by aspect with the “Enterprise” plan, which is priced at $150,000/12 months. Does Ansible or Chef Have Higher Assist?
Chef is an older product, so its documentation is healthier than Ansible’s.
That mentioned, the higher documentation could also be as a consequence of the truth that there’s extra to be taught than with Ansible.
Chef affords assist for Linux, *nix and Home windows. The browser-based GUI is nice however not as full as Puppet and is missing options like reporting and superior config choices.
Chef’s relative maturity means it might enchantment to firms who place a premium on stability greater than people. IT is legendary for avoiding documenting something, so it is no shock that Ansible’s documentation remains to be a weak level.
That is mitigated considerably by how straightforward it’s to be taught.
Ansible is simply out there for Linux and Unix and its GUI is worse than Chef’s, it would not sync to the CLI, so the GUI and CLI can provide totally different outcomes.
Ansible’s agentless push-mode utilizing the ZeroMq implementation on the transport layer means fast deployment and low efficiency overhead, the caveat is it’s simply not as versatile and highly effective as utilizing brokers.
Ansible vs Chef vs Different Configuration Administration Instruments
Ansible and Chef vie for management with different notable configuration administration instruments like SaltStack, Terraform and Puppet among the many most notable.
These instruments serve the aim of provisioning and sustaining server farms in a predictable, time-saving vogue whether or not hosted on-premise or on cloud platforms like Azure and AWS.
Giant scale deployment include distinctive challenges like sustaining purposes, compliance necessities, patching, configuration drift and software program upgrades all pose a novel problem to DevOps groups.
DevOps instruments are likely to fall into two classes:
Orchestration: Offers with provisioning servers and different infrastructure together with databases throughout clusters whereas handing over accountability for managing the software program working on the situations to configuration administration instruments.Configuration administration: Give attention to managing the software program on infrastructure nodes, together with set up and upgrades on servers already in existence
Different DevOps instruments:
SaltStack: Written in Python, SaltStack(Salt) holds your stock’s state on a grasp server, with YAML being the default format for storing configurations. SaltStack templates use the Jinja templating language, which will probably be acquainted to Python customers.Puppet: One other device on the configuration administration aspect, Puppet requires a grasp server, referred to as the Puppet grasp, which shops the configuration of your infrastructure and pushes adjustments out to shoppers. Like Ansible Tower, Puppet Enterprise comes with an internet dashboard, Puppet Enterprise Console, for managing your stock.Terraform: A distinct strategy to each Ansible and Chef. Terraform focuses on organising your complete infrastructure and provisioning servers. As such, it falls on the orchestration aspect of the spectrum, however it may be used alongside configuration targeted instruments like Chef and Ansible.
Many DevOps groups have discovered methods to combine and match CM instruments to swimsuit the complexity of their configuration and orchestration wants. Typically working on virtualization options resembling Docker containers, Vagrant, Kubernetes and others.
Containerization with Docker is an interesting path to go as a result of Docker containers assist ease the configuration course of whereas providing portability throughout varied server working techniques and cloud suppliers.
In some situations, options like Kubernetes or Docker can deal with most of your configuration administration wants. As an example, Docker photographs can have all of your software program necessities put in.
It’s also potential to make use of Ansible or Chef to deploy Docker containers and handle them, with prepared plugins out there within the type of a built-in Docker module on Ansible, and a Docker cookbook from the Chef Grocery store.
By way of recognition for particular person configuration administration instruments, Ansible is now forward of the pack, with a survey from TechRepublic displaying that Ansible had probably the most widespread utilization throughout survey respondents, at 41%, adopted by Chef and Puppet in a tie at 31%, with Terraform at 31%, and Saltstack at 18%.
Conclusion
First off, any admin or DevOps will probably be mighty glad to have such instruments of their nook; only a few years in the past there was a lot much less alternative on this discipline. Selecting both of them is a win, and your life will probably be richer and simpler for it.
That mentioned, in case you should select between them, think about your personal wants fastidiously first and weigh them in opposition to what every answer affords. You need to use the infographic beneath to match Chef and Ansible.