Traditionally, software developments happen for months and tested in phases during the development. Once all the features are developed then it is released to customer to deploy in production. The production team will procure machines and install software’s would take another few months.
With the penetration of cloud all the hardware setup (IAAS) is provided by the cloud vendors, customers only do the software installations.
So as soon as the some feature develop and it is readily available to customers. Cloud technology changes the software industry dramatically from the point for application development to the release of it to end customers.
So software becomes the center point of competition for all the traditional companies who are developing products from decades. Businesses expect quicker responses on the product features and necessary changes the strategy to align with the business. In order to make that happen, DevOps principles came into picture.
DevOps – There is no clear cut definition of DevOps. Basically Software development journey starts with a short check point. It is a process of software development from idea to end users. So faster the development, things start breaking faster where DevOps come in handy.
In general terms it is cultural shift of breaking down the barriers between development and operations. The name itself says Dev + Ops, the principles itself developed in a way that work will be visible to everyone and effectively communication happens across the teams transparently. DevOps is a union of 3p’s people, process and products to enable continuous delivery of value to our end users.
The contraction of ‘Dev’ and ‘Ops’ refers to replacing Development and Operations to create multidisciplinary teams that now work together with shared and efficient practices and tools.”
DevOps team has to deal with so many combinations of products/technologies. Each of these combinations has to be handled in a different way.
As we already discussed about DevOps is a process of making use of set of tools to automate the underlying technologies. Among those tools, Infrastructure-as-a-code is one segment of process, by using which we can automate the underlying infrastructure. The available Infrastructure as a code tools are Chef, Puppet, Slatslack , Ansible..
What is Ansible?
Ansible is an open source IT automation engine that can improve the scalability, consistency, and reliability of your IT environment. Ansible is an automation tool which manages the servers and makes IT engineer’s life easy.
Managing regular tasks like patching, provisioning or software installation of few servers is easy. If you have 100’s of servers then it is a difficult for doing manually. Ansible automation engine is designed in such a way it can run on 1000’s of machines at a time bring them to the same level of configuration.
What are the advantages of Ansible?
- Easy installation and initial setup.
- Easy remote execution via SSH.
- Agent-less deployment – generally communication is faster than the master-agent model. You do not need to have anything installed on the client’s
- Syntax is easy to learn for new users.
- Sequential execution order.
- Suitable for environments designed to scale rapidly.
- Powerful orchestration engineand zero- downtime rolling updates to multi-tier applications across the cloud.
- Supports both push and pull models.
- High security with SSH.
- It is new to the open source world and not entirely mature as compared to other tools.
- Increased focus on orchestration over configuration management.
- SSH communication slows down in scaled environments.
- Underdeveloped GUI with limited features.
How to install Ansible?
Ansible installation is pretty easy if you know how to install packages in Linux. Package managers like yum, apt and dnfcan be used to obtain a stable version and usually pip provides latest version
Important configuration file in Ansible is “Inventory File”:
Inventory defines the list of the hosts that we are going to manage. We can group them logically in certain roles. For example, we would want to group our messaging servers in one group and application servers in another. One server can be a part of single group or multiple groups and also one group can have multiple servers.
The default inventory file is defined under/etc/Ansible/ansible.cfg off-course it is possible to convert any file to inventory file by passing –I flag to the Ansible command. For cloud environments like Amazon there are plugins and modules available to generate inventory dynamically.
Important components of Ansible:
Ansible modules are reusable scripts that can be used by the Ansible API, or by Ansible-playbook programs. They return information to Ansible by printing a JSON string to stout before exiting. Modules are the executable plugin which do the real job.
Roles define what to do, what not to do on a particular server. For an application server can have user management role and basic configuration roles.
Playbook is the core component of Ansible by using one can automate of multiple servers at a time. Ansible Playbook is a YAML file which contains one or more plays defines the work to be done. Based on the specific environment requirement each play is written by the administrator.
If we want to invoke only parts of a role or a playbook then tags can enable us to do it in Ansible. For example, you need to add a new group to the system but don’t want to run the whole role or playbook for that.
Nutshell, Ansible not only supports setting up bare-metal and virtualized environments, it can actually go one step ahead and setup a cloud based environment with providers like AWS,GCP,OCI etc.