Points to study →
- What is ansible
- Ansible V/S Terraform
- History of Ansible
- Architecture of Ansible
- Terms used in Ansible
What is Ansible →
Ansible is DevOps tool and it is similiar like chef means it is a Configuration management tool let’s Begins with a Story →suppose you have a big organisation which have 100’s of servers Now a task is came to install git on that 100’s of servers …man responsible for doing this is System Administrator who is doing this manually which takes a lot of time… guess what happen if we have a tool in which we click once to install and git is install in all the servers in that way we save a big whole time of installing it on one by one
guys!!!! we have that tool and that is Ansible→ A Configuration Management Tool…..
But !! But !! But !! First you need to connect all the nodes to ansible server which is done manually after that you will be able to automate the things…..
configuration management →It is a method through which we automate admin tasks.
It automates the task which the system administrator doing manually
Ansible v/s Terraform →
ansible is a configuration management tool which means if you want to install git on 100s or 1000s of machine you won’t able to do it manually it takes a lot time but ansible do it in just one click all you need to do write a YAML Script in which ansible runs and just enter and git would be ready to work on those servers
but
if you want to create 100 servers than you use terraform by writing a code in hcl language using .tf extension of the file and than run terraform apply and your 100 of servers is ready
therefore
terraform is a infrastructure building tool while ansible is a configuration management tool
Configuration management tool is of 2 types →
- Pull based → In Pull Based it periodically check for the update from the main server to the nodes if update available it automaticlly install on the nodes connnected with the server →chef and puppet is a pull based config tool
- Push based → In push based nodes is not going to the main server for the update the update is pushed to the nodes automatically for example the update of apps is pushed to your phone playstore now it’s your choice whether you update or not → push based tool is Ansible when you need control in your hands so you take control of your own server for updation.
History of Ansible →
- Michael Dehan developed Ansible in Feb 2012
- Red Hat acquired the Ansible tool in 2015.
- Ansible is available for RHEL, Dabian, cent OS, Oracle Linux.
- It is developed in Python background and also in Windows PowerShell.
- You Can use this tool whether your server are in on premises or in the cloud.
- It converted your code into infrastructure means you can say that it is a little bit called an Infrastructure building tool
Architecture of Ansible →
Image at the top indicate the architecture of Ansible It is based on client server having one server node connected to multiple nodes and push the updates to all the nodes in one click
Important terms and points in Ansible →
- Not 100% automation because of push based mechanism Nodes does not automatically install the updates.
- YAML → The code you provide is written in YAML script
- Agentless →Like chef-cleint and ohai in chef is not available here
- Using ssh to communicate
- Playbook → Just like recipe in chef(click here to read a blog on chef)
- Ansible Server → The machine where ansible is installed and from which all task and playbooks is ran
- Module →Basically , a module is a command or set of familiar commands meant to be executed on the client side
- Task → A task is a section that consists of a single procedure to be completed