How to Install Ansible and Manage Servers


Enterprise IT needs more than traditionals IT tools. Because there are different architechture and styles in IT infrastructure. In a small company one web server is enough for all but in a enterprise company there may be 10 – 100 web servers for the departments different needs.

Here one of the most important thing is orchestration and management of the infrastructure simple and confident way. Ansible is a tool that gives the ability to the server admins or devops.


We will use fedora server 24 for this tutorial and our architechture is 64 bit. 1 GB is enough for simple tests but keep in mind that there is more if your work is complex. We have two servers named poftut1 and poftut2. We will manage from poftut1 the two servers.

Install nano for editing ansibles hosts file.

Open and add servers with ip address as a group named poftut_servers

Add following lines. This file is called inventory in ansible terminology.

Start Simple

We have completed installation and setup. Now we will try to access our servers by using their group name.

LEARN MORE  Bash For and While Loop Examples

Hmm there is a problem. We can not run hostname command here. Because we have to provide password for the current user or setup key based authentication for ssh. Second is more secure.

Now try again same simple command.

Now create a directory in all servers in our poftut_servers group.

It seems success but we can make double check with ansible by listing the directory.

LEARN MORE  How To Create Fast Simple Database and Table With Php and Sqlite

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)