# New to Ansible

**URL:** <https://forum.ansible.com/t/new-to-ansible/22289>\
**Category:** Ansible Project\
**Created:** [August 15, 2016, 8:30am UTC](https://forum.ansible.com/t/new-to-ansible/22289 "2016-08-15T08:30:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Ramesh](https://forum.ansible.com/u/Ramesh)\
**Post date:** [August 15, 2016, 8:30am UTC](https://forum.ansible.com/t/new-to-ansible/22289/1 "2016-08-15T08:30:23Z")

</div>

Hi ,

I am new to this Ansible.

I was gone through the first step, and got the below update.

```auto
sudo easy_install pip
Searching for pip
Best match: pip 8.1.2
Processing pip-8.1.2-py2.7.egg
pip 8.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Using /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

```

I was gone through the second step, and gone through the below error. Can you help on fixing this.

```auto
sudo pip install ansible
The directory '/Users/Ramesh/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/Ramesh/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
...
...
...

<b>Command "/usr/bin/python -u -c "import setuptools, tokenize; __file__ ='/private/tmp/pip-build-a1b7Ba/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)( __file__ ).read().replace('\r\n', '\n'), __file__ , 'exec'))" install --record /tmp/pip-hjCGT7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-a1b7Ba/pycrypto/
</b>

```

**​**

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [August 15, 2016, 2:35pm UTC](https://forum.ansible.com/t/new-to-ansible/22289/2 "2016-08-15T14:35:32Z")

</div>

This is how I setup Ansible on a vanilla Ubuntu 14.04 box:  
[https://gist.github.com/trondhindenes/01cbcd3e3a98ff57fc00cc5fde97545a](https://gist.github.com/trondhindenes/01cbcd3e3a98ff57fc00cc5fde97545a)

---

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [August 15, 2016, 4:15pm UTC](https://forum.ansible.com/t/new-to-ansible/22289/3 "2016-08-15T16:15:04Z")

</div>

i also got errors doing this as root. heres how i do it as a user in os x.  
you might need developers tools for some of ansibles dependencies.

make sure ~/Library/Python/2.7/bin is in your path.

easy\_install --user pip  
pip install --user cryptography  
pip install --user ansible

---

<div class="post-metadata">

**Author:** ![FISH](https://avatars.discourse-cdn.com/v4/letter/f/bc8723/32.png) [@FISH](https://forum.ansible.com/u/FISH)\
**Post date:** [August 16, 2016, 3:01am UTC](https://forum.ansible.com/t/new-to-ansible/22289/4 "2016-08-16T03:01:29Z")

</div>

Hi,

Thanks to all.

I created the setup of “vagrant with cent OS”.

When I do configuration, I could see the below error after done with “ping” command.

```auto

[root@localhost ansible]# ansible example -m ping -u vagrant
localhost | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh.",
    "unreachable": true
}
[root@localhost ansible]#

```

My configuration file is like this:

```auto
## db-[99:101]-node.example.com
[example]
localhost

```

and my hostname is like this

```auto
[root@localhost ansible]# hostname
localhost.localdomain
[root@localhost ansible]#

```

Can you help me on fixing this. What are the steps required to finish this.

​

---

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [August 18, 2016, 4:48pm UTC](https://forum.ansible.com/t/new-to-ansible/22289/5 "2016-08-18T16:48:14Z")

</div>

sounds like a vagrant issue. ask here: [https://groups.google.com/forum/?utm\_medium=email&utm\_source=footer#!forum/vagrant-up](https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!forum/vagrant-up)

---

<div class="post-metadata">

**Author:** ![Ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Ramesh](https://forum.ansible.com/u/Ramesh)\
**Post date:** [August 18, 2016, 4:58pm UTC](https://forum.ansible.com/t/new-to-ansible/22289/6 "2016-08-18T16:58:33Z")

</div>

But this is the way we have to give hostname?

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [August 18, 2016, 8:34pm UTC](https://forum.ansible.com/t/new-to-ansible/22289/7 "2016-08-18T20:34:19Z")

</div>

Localhost will work regardless of the actual name of the computer you’re running on, it’s literally 127.0.0.1.  
If you have trying to do something against a node which is not the node you’re running ansible from, you shouldn’t name that node localhost.

---

<div class="post-metadata">

**Author:** ![Ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Ramesh](https://forum.ansible.com/u/Ramesh)\
**Post date:** [August 20, 2016, 7:43am UTC](https://forum.ansible.com/t/new-to-ansible/22289/8 "2016-08-20T07:43:29Z")

</div>

Hi

I fixed it on my own.

I have to give the user name, and that will work. Thanks all.

```auto

[root@localhost ~]# ansible all -m ping -s -k -u vagrant
SSH password:
127.0.0.1 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
[root@localhost ~]#

```
