Ansible

Ansible is a simple automation language used for software provisioning, configuration management and application deployment. ad-hoc task-execution, and multinode orchestration. 

It’s a simple automation language that can easily be understood by everyone and there are no special skills required to understand the playbook.

Ansible is mainly in two types controlling machine and nodes. Controlling machine which is where the orchestration begins. Nodes are managed by a controlling machine over SSH. Location of the hosts are descried via the inventory. Ansible deploys modules to nodes over SSH. Modules in the nodes are communicating with the controlling machine through  a JSON protocol.

Ansible doesn’t consume resources because no daemons or programs are executed for Ansible in the background and it’s secure as Ansible does’nt deploy agents to nodes. Only OpenSSH is required.

Ansible Tasks are idempotent. bash scripts are mainly not consider for rerunning the task  repeatedly. Ansible uses “Facts” to check state and displays the output with the status of change after the task. This makes it safe to run Ansible Tasks more times without any issue.

Modules:

Modules are the part of Ansibile. Each module is mostly in standalone and can be written in standard scripting languages such as python, Perl, Ruby, bash etc. Modules is idem-potency which means that if we repeat the operation multiple times it will not change the state of the system.

ansible all -s -m shell -a 'apt-get install nginx'  

1) Installation of Ansible in different OS

Ansible is “agentless” – there’s no external agents required to run the task in the server.

For Ubuntu:

sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible

2) Centos:

 sudo yum install ansible 

Post navigation

Leave a Reply