New to DevOps (Week #4)

New to DevOps (Week #4)

Infrastructure as Code (IaC)

For years the IT infrastructure has been facing a lot of problems such as - slow deployment, cost rising, limited automation, human error, wasted resources etc. To solve this problem Infrastructure as Code (IaC) tools allow us to manage the IT infrastructure through configuration files which include all the key information to carry out the task instead of using the GUI repeatedly. IaC allows us to build, change, improve, share and reuse the code according to the needs. IaC is safer, better and consistent. Two such tools - Ansible and Terraform briefly explained here.

Ansible

Ansible is an open-source tool for IT configuration management, deployment and orchestration sponsored by Red Hat.

Uses of Ansible

Ansible uses the concepts of control and managed nodes. It connects from the control node, any machine with Ansible installed, to the managed nodes sending commands and instructions to them. The units of code that are written using Ansible playbooks in YAML files to carry out the task on the managed node(s) using a few commands. The managed nodes are represented in a simplistic inventory file that groups all the nodes into different categories. Ansible doesn't require the installation of any extra agents on the managed nodes and it's simple to code.

Terraform

Terraform is a tool provided by Hashicorp and is an important tool for infrastructure as code. It lets us define resources and infrastructure in human-readable, declarative configuration files and also manages the infrastructure's life cycle.

Uses of Terraform

Using Terraform will make life easier to code or set up the infrastructure required for running the apps, scaling them and much more. Terraform can manage infrastructure on multiple cloud platforms. It's easier to understand and code. Terraform's state allows us to track resource changes throughout our deployments. One can commit the configurations to version control to safely collaborate on infrastructure. Be it creating instances, scaling them, dumping the instances, managing different nodes, be it anything Terraform in particular and Infrastructure as Code, in general, has made things easier and less complex.