Ansible is simple IT Automation Tool

Ansible is powerful tool for automate application and IT Non IT infrastructure. Continuous Development, Integration and Deployment and Configuration Management. Work on agent less with SSH configuration or zero downtime rolling updates. It's open source tool. For more details Click Me

Ansible, yml, playbooks flow

Installation details Click Me
Note: Install Python 2.7.x and Install Ansible

Installation verification:
Logging into server, change the dir to /opt/ansible
[ansible@tutorialbyexample ansible]$ ansible --version
ansible 1.7

Default installation directory /opt/ansible

Creating a basic inventory file
Inventory file in Ansible have list of servers to communicate with. Inventory file known as hosts file located under /etc/ansible/hosts content name of group and IP's.

$ sudo mkdir /etc/ansible
$ sudo touch /etc/ansible/hosts

Edit this hosts file with any editor whatever you like e.g: nano, vim. Note you’ll need to edit it with
sudo/as root. As all data or host are accessible by root/or equivalent user only.



Save & quit it.

Where as [local] is name of group going to identified by list of IP's. We can add multiple group and respective IP's' E.g:




All IP's are example only.

How to execute the simple free -m command in Ansible:

[ansible@tutorialbyexample ansible]$ ansible local -a "free -m" -u ansible -k
SSH password: | success | rc=0 >>
             total       used       free     shared    buffers     cached
Mem:  15951    15742      208          0       1725      11903
-/+ buffers/cache:       2113      13837
Swap:         1023          4       1019

[ansible@tutorialbyexample ansible]$ ansible local -a "df -h" -u ansible -k
SSH password: | success | rc=0 >>
Filesystem                  Size  Used Avail Use% Mounted on
/dev/tutorialbyexample1     29G   26G  1.9G  94% /tutorialbyexample1
/dev/tutorialbyexample2     29G   15G   13G  54% /tutorialbyexample2

In next tutorial we'll see how ansible playbook.yml work.

Please provide your input if any. Have good day ahead!!!



  1. Good for startup about ansible...

  2. This comment has been removed by a blog administrator.

    1. Good to see your comments about my post, but you are also doing promotion of your course! I will suggest go through the below link and you will get more details about it.

  3. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. montaggio cancello automatico


Please provide your input, it will honer for me...