Ansible quick notes

Ansible is an IT automation tool to fulfill DevOps requirements. Ansible is written in Ruby, python, and powershell.

Ansible is used for cloud provisioning, application deployments, server patching , rebooting, configuration management, and many more IT tasks fulfillment.

Ansible Scripts are written in ansible playbook(s). I will include few sample playbooks and explain the its own declarative language below in this article.


What’s make Ansible so unique and top winner?

The main feature of Ansible is that it does not need Agents or any other special security infrastructure unlike other IT automation tools in the market.
Ansible just needs its automation jobs written in YAML file called as Ansible playbooks. 


What is Ansible Role directory structure ?

Role directory structure contains tasks, handlers, vars, files, templates etc. Roles helps to automatically load these. Ansible playbook is a mapping between hosts and Roles. E.g. are site.yml, webserbers.yml etc. While roles are set of tasks and variables.
Typical ansible directory layout contains inventory files to represent production and other staging environments.There will be master playbook yml files, webserver, dbserver yml files, other libraries representing custom modules like utility, plugins yml files, group and host representatives yml files, then roles as discussed above contains set of yml files and finally if needed monitoring yml files can also be added to a playbook.

 

-name: install a package
    yum:
      name: nginx
      state: installed
      validate_certs: no
      skip_broken: yes