How to Install and Configure ‘Ansible’ Automation Tool for IT Management – Part 1

Page 1 of 212

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Babin Lonston

I'm Working as a System Administrator for last 10 year's with 4 years experience with Linux Distributions, fall in love with text based operating systems.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

31 Responses

  1. MD says:

    Thanks for this post., I am looking for installation of ansible from the servers which is not exposed to internet. I downloaded the ansible tar.gz from git hub and ran make command but getting error as below
    ansible –version
    Traceback (most recent call last):
    File “/home/jboss/Ansible/ansible-2.1.1.0/bin/ansible”, line 44, in
    import ansible.constants as C

    I tried adding the env variables like below but again seeing exception
    ANSIBLE=/home/xxx/Ansible/ansible-2.1.1.0
    export PATH=$PATH:$ANSIBLE/bin
    export PYTHONPATH=$ANSIBLE/lib
    export ANSIBLE_LIBRARY=$ANSIBLE/library

    Error:
    ansible:85: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
    if e.message.endswith(‘ %s’ % sub):
    ERROR! Unexpected Exception: No module named yaml
    the full traceback was:

    Traceback (most recent call last):
    File “/home/jboss/Ansible/ansible-2.1.1.0/bin/ansible”, line 81, in
    from ansible.cli.adhoc import AdHocCLI as mycli
    File “/home/jboss/Ansible/ansible-2.1.1.0/lib/ansible/cli/__init__.py”, line 27, in
    import yaml
    ImportError: No module named yaml

    Kindly suggest to prepare install the prerequisites and ansible in my situation

  2. drmarconi says:

    Noticed a possible typo – shouldn’t the prerequisite “parmiko” be “paramiko”? As in python-paramiko package (or pip install paramiko)?

  3. Nakul says:

    Hi,
    When i tried to copy remote server to ssh, then i got below error.

    ]$ ssh-copy-id 10.247.146.163
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed — if you are prompted now it is to install the new keys
    akumar3@10.247.146.163‘s password:

    Could not chdir to home directory /export/home/akumar3: No such file or directory

    Please suggest.

  4. Erick Bazan says:

    hi, excellent post, just having a doubt here, I’m getting the same error sampada does, I already tried with the user the ssh keys generated, any idea what might be happening? thanks

  5. Sampada Jain says:

    Hi I am trying to set up a ansible lab on azure cloud and trying to get hand on to replace puppet actually.
    But when I m trying to run : [ ansible -m ping web-servers ]
    I am getting a error as : as mentioned below in-between [ ]

    [
    10.1.0.17 | UNREACHABLE! => {
    “changed”: false,
    “msg”: “Failed to connect to the host via ssh.”,
    “unreachable”: true
    }

    ]

    So I tried command : [ ansible -m ping web-servers:2222 ]
    But i am still getting the error as : [ [WARNING]: provided hosts list is empty, only localhost is available ]

    Can somebody help me please

    Thank you
    Sampada

  6. Prince Chaudhary says:

    it was really interesting…

  7. David leatherman says:

    Thanks, very useful for a new user of ansible….

  8. Daniel says:

    Hello. I am trying to setup ansible on my home network for testing and mabey replace puttet if i like anisble.
    BUT! I have copied the key from my anisble host to my test vm, added the ip for my test vm in sudo vim /etc/ansible/hosts under [web-servers]
    but when i am trying to ping the test vm from anisble then i get this message ?

    # ansible -m ping web-servers
    # No hosts matched

  9. kranzella says:

    Excellent, nice job! :)
    Thanks

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?