Veeksha A V
Aug 31, 2018 · 3 min read

Configuration Management Tools (Ansible v/s Puppet)

Configuration management tools are very popular these days with a kind of power they have in order to achieve desired state of remote servers at any point in time there by reducing manual intervention of logging into each and every servers and performing same activities every now and then , hence reducing human error and time. Among many of such tools (ansible,chef,puppet,salt etc..) , I was involved in the activity to manage remote servers using Puppet and Ansible. Hence, sharing my insights and experience in this post.

There always exists a question which is the best configuration management tool to use in our environment (deploy and manage the application) . To get your answer, please consider below 3 points -

  1. ADAPTABILITY → How easily and effectively your existing install , upgrade and roll back scripts of different versions of your application/solution can be re-written using a configuration management tool scripts ?
  2. FREQUENCY → How often configuration needs to updated on remote servers ?
  3. FUTURE → Determine expected increase in the number of servers where application needs to deployed and maintained in near future.
Ansible V/S Puppet

Ansible is written in python whereas Puppet is written using ruby. Setting up Ansible environment is much easier than setting up Puppet environment. Ansible setup is agentless but has a controller node containing core logic (configuration of application) and from the controller node one has to push configuration to remote servers whereas Puppet setup has a master , agent nodes where the master node contains core logic and the agent nodes pull the catalog/configuration from master after every 30 minutes(default configured time to pull catalog from master). Tasks in Ansible scripts gets executed in serial order wheres tasks in Puppet scripts needs to be ordered because there is no guarantee of the order of execution of tasks on remote servers. Some properties of a node can be stored in Puppet Database using exported resource (such as ‘file’) and then collect such exported resources on other nodes to perform some operation based on the values of exported resources whereas Ansible does not have any such provision. Puppet environment with respect to memory needs to be tuned when nodes to be managed grows whereas in Ansible environment there is no such management required because changes or configuration can be pushed in batches or one can easily bring up another controller node to handle more nodes whereas bringing up another Puppet environment is tedious. Recovery of Ansible controller node is faster and easier than that of Puppet master. Puppet provides you a nice and dynamic approach(based on values of custom or predefined facts) of arranging the data (values for variables) in files within a single data directory for an environment using Hiera with facts wheres in Ansible there are provisions of arranging the data applicable to different groups and individual hosts in different directories and also in inventory file which are static in nature. Key factor one should consider when using any configuration management tool is making the tasks in scripts idempotent (Only when there is a change in the state of remote resource , then only tasks should be run to bring into a desired state else tasks need not to be run). Hence on the whole choosing configuration management tool is a trivial task , it mainly depends on what you want to do using it efficiently by exploring the functionalities provided by the existing configuration management tools.

Veeksha A V

Written by

A Software Engineer with a can do attitude, enjoy learning new things in life.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade