Facebooktwittergoogle_plusredditpinterestlinkedinmail

What is Ansible?

Ansible is Simple IT automation tools that managing your server infrastructure, Including Code Deploys, Handling services on your remote server, Installations and configurations server.

Here are some more key properties of Ansible:

  • Dead simple setup
  • Super fast & parallel by default
  • No server or client daemons; use existing SSHd out of the box
  • No additional software required on client boxes
  • Can be easily run from a checkout, no installation required
  • Modules are idempotent, but you can also easily use shell commands
  • Modules can be written in ANY language capable of returning JSON or key=value text pairs
  • Awesome API for creating very powerful distributed scripts
  • Does not have to run remote steps as root
  • Pluggable transports (SSH is just the default)
  • Source host info & variables from files or external software
  • The easiest config management system to use, ever.

Ansible Installation:

Getting started with ansible , installations steps for CentOS. You can find more details about other OS installation steps on official website.

You need some perquisites before installation ansible on centos

1)    Python 2.6 +

$ yum install python

2)    Additional python libraries

$ yum install python-paramiko
$ yum install PyYAML
$ yum install python-jinja2

I am installing ansible from my user named “roop”. So my current directory path is “/home/roop/”

Create your ansible project directory. for e.g I am using “myansible”

$ makdir myansible
$ cd myansible
$ git clone git://github.com/ansible/ansible.git
$ ./ansible/hacking/env-setup

It will setup ansible env . You will get output as below

Setting up Ansible to run out of checkout...

PATH=/home/ /roop/myansible/ansible/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/roop/bin
PYTHONPATH=/home/roop/myansible/ansible/lib:
ANSIBLE_LIBRARY=/home/roop/myansible/ansible/library:/usr/share/ansible/
MANPATH=/home/roop/myansible/ansible/docs/man:
Remember, you may wish to specify your host file with -i

Done!

So to setup ansible you need to run ./ansible/hacking/env-setup from your ansible directory (e.g myansible).

To avoid loss of env variable after session end please add below inside .bashrc . In my case as I am doing this roop user so I need to add in /home/roop/.bashrc

if [ -f ~/../home/roop/myansible/ansible/hacking/env-setup ]; then
source ~/../home/roop/myansible/ansible/hacking/env-setup -q
fi

Now write servers name in hosts file which you want to manage through ansible

You can write single hosts name or group of host name in host file like below

/etc/ansible/hosts

192.168.0.1

 

Or group multiple server with name

/etc/ansible/hosts

[webserver]
192.168.0.1
192.168.0.2
192.168.0.3

Now check your ansible is up or not

$ ansible all –m ping

Reference:-

http://server.dzone.com/articles/ansible-cm-deployment-and-ad
http://www.ansible.com/how-ansible-works

Getting Started with Ansible Roopendra AnsibleDevOPS
What is Ansible? Ansible is Simple IT automation tools that managing your server infrastructure, Including Code Deploys, Handling services on your remote server, Installations and configurations server.Here are some more key properties of Ansible:Dead simple setup Super fast & parallel by default No server or client daemons; use existing SSHd out of...
<h4>What is Ansible?</h4> Ansible is Simple IT automation tools that managing your server infrastructure, Including Code Deploys, Handling services on your remote server, Installations and configurations server.Here are some more key properties of <a href="http://ansible.github.com/">Ansible</a>: <ul class="simple"> <li>Dead simple setup</li> <li>Super fast & parallel by default</li> <li>No server or client daemons; use existing SSHd out of the box</li> <li>No additional software required on client boxes</li> <li>Can be easily run from a checkout, no installation required</li> <li>Modules are idempotent, but you can also easily use shell commands</li> <li>Modules can be written in ANY language capable of returning JSON or key=value text pairs</li> <li>Awesome API for creating very powerful distributed scripts</li> <li>Does not have to run remote steps as root</li> <li>Pluggable transports (SSH is just the default)</li> <li>Source host info & variables from files or external software</li> <li>The easiest config management system to use, ever.</li> </ul> <h4>Ansible Installation:</h4> Getting started with ansible , installations steps for CentOS. You can find more details about other OS installation steps on <a href="http://docs.ansible.com/intro_installation.html">official website</a>. <h5>You need some perquisites before installation ansible on centos</h5> 1)    Python 2.6 + <pre><code>$ yum install python</code></pre> 2)    Additional python libraries <pre><code>$ yum install python-paramiko $ yum install PyYAML $ yum install python-jinja2 </code></pre> I am installing ansible from my user named <strong>"roop"</strong>. So my current directory path is <strong>"/home/roop/"</strong>Create your ansible project directory. for e.g I am using <strong>"myansible"</strong> <pre><code>$ makdir myansible $ cd myansible $ git clone git://github.com/ansible/ansible.git $ ./ansible/hacking/env-setup </code></pre> It will setup ansible env . You will get output as below <pre><code>Setting up Ansible to run out of checkout...PATH=/home/ /roop/myansible/ansible/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/roop/bin PYTHONPATH=/home/roop/myansible/ansible/lib: ANSIBLE_LIBRARY=/home/roop/myansible/ansible/library:/usr/share/ansible/ MANPATH=/home/roop/myansible/ansible/docs/man: Remember, you may wish to specify your host file with -iDone!</code></pre> So to setup ansible you need to run <strong>./ansible/hacking/env-setup</strong> from your ansible directory (e.g myansible).To avoid loss of env variable after session end please add below inside .bashrc . In my case as I am doing this roop user so I need to add in <strong>/home/roop/.bashrc</strong> <pre><code>if [ -f ~/../home/roop/myansible/ansible/hacking/env-setup ]; then source ~/../home/roop/myansible/ansible/hacking/env-setup -q fi</code></pre> Now write servers name in hosts file which you want to manage through ansibleYou can write single hosts name or group of host name in host file like below<strong>/etc/ansible/hosts</strong> <pre><code>192.168.0.1</code></pre>  Or group multiple server with name<strong>/etc/ansible/hosts</strong> <pre><code>[webserver] 192.168.0.1 192.168.0.2 192.168.0.3</code></pre> Now check your ansible is up or not <pre><code>$ ansible all –m ping</code></pre> Reference:-<a href="http://server.dzone.com/articles/ansible-cm-deployment-and-ad">http://server.dzone.com/articles/ansible-cm-deployment-and-ad</a> <a href="%20http://www.ansible.com/how-ansible-works"> http://www.ansible.com/how-ansible-works</a>
(Visited 675 times, 9 visits today)
Facebooktwittergoogle_pluslinkedinrss