# Running ansible on local Linux desktop hangs on Gathering Facts

**URL:** <https://forum.ansible.com/t/running-ansible-on-local-linux-desktop-hangs-on-gathering-facts/13483>\
**Category:** Ansible Project\
**Created:** [September 16, 2013, 12:00pm UTC](https://forum.ansible.com/t/running-ansible-on-local-linux-desktop-hangs-on-gathering-facts/13483 "2013-09-16T12:00:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Turner](https://avatars.discourse-cdn.com/v4/letter/b/77aa72/32.png) [@Ben\_Turner](https://forum.ansible.com/u/Ben_Turner)\
**Post date:** [September 16, 2013, 12:00pm UTC](https://forum.ansible.com/t/running-ansible-on-local-linux-desktop-hangs-on-gathering-facts/13483/1 "2013-09-16T12:00:44Z")

</div>

Hi,

I’ve used ansible with some success on remote servers, but wanted to build up a quick playbook to build on dev boxes quickly.

So I wrote out a small playbook to just install some apt packages, and run it - but it seems to get “stuck” at Gathering Facts.

Any idea what might be missing ? I’ve installed openssh-server on the machine (assuming ansible needs this to connect) and I’m just connecting using my SSH password for now, to avoid any key issues.

I’ve enclosed the output below, with some verbose logging:

ben@vostro ~/code/ansible\_recipes $ ansible-playbook -i hosts -k devbox.yml -vvv  
SSH password:

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [September 16, 2013, 12:34pm UTC](https://forum.ansible.com/t/running-ansible-on-local-linux-desktop-hangs-on-gathering-facts/13483/2 "2013-09-16T12:34:24Z")

</div>

It’s most likely hung waiting for the sudo password, since you did not also specify the -K option to ansible-playbook. Add that option and you should get past the hang since it will prompt you for the sudo password.

---

<div class="post-metadata">

**Author:** ![cpatanaik](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@cpatanaik](https://forum.ansible.com/u/cpatanaik)\
**Post date:** [September 16, 2013, 1:10pm UTC](https://forum.ansible.com/t/running-ansible-on-local-linux-desktop-hangs-on-gathering-facts/13483/3 "2013-09-16T13:10:37Z")

</div>

Ansible performs SSH to the server @ username specified by -u option(the current logged in user if -u is missing). So if you don’t have passwordless sudo, then it will prompt you for a password. You are also missing --ask-pass option.

The correct systax is

```auto
ansible atlanta -a "/usr/bin/foo" -u username --sudo [--ask-sudo-pass]

```

---

<div class="post-metadata">

**Author:** ![Ben\_Turner](https://avatars.discourse-cdn.com/v4/letter/b/77aa72/32.png) [@Ben\_Turner](https://forum.ansible.com/u/Ben_Turner)\
**Post date:** [September 16, 2013, 10:58pm UTC](https://forum.ansible.com/t/running-ansible-on-local-linux-desktop-hangs-on-gathering-facts/13483/4 "2013-09-16T22:58:56Z")

</div>

Many thanks, that was it.

Because I’m used to seeing the following prompts with the -kK options…

SSH password:  
sudo password [defaults to SSH password]:

… and because, in this case, they ARE the same value, I’d assumed that the sudo password defaulted to the SSH password. Which it does… but of course it also hangs waiting for user input it if the -K option isn’t supplied !

One of those “now I see it, I can’t believe I didn’t see it” moments.

Cheers,  
Ben

---

<div class="post-metadata">

**Author:** ![Ben\_Turner2](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Ben\_Turner2](https://forum.ansible.com/u/Ben_Turner2)\
**Post date:** [March 19, 2014, 8:20pm UTC](https://forum.ansible.com/t/running-ansible-on-local-linux-desktop-hangs-on-gathering-facts/13483/5 "2014-03-19T20:20:09Z")

</div>

I actually found this thread because I came across the same problem and now I’m scared because I met another Ben Turner in this exact spot.

ARE YOU ME?

---

<div class="post-metadata">

**Author:** ![Paul\_Durivage](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Paul\_Durivage](https://forum.ansible.com/u/Paul_Durivage)\
**Post date:** [March 21, 2014, 4:46pm UTC](https://forum.ansible.com/t/running-ansible-on-local-linux-desktop-hangs-on-gathering-facts/13483/6 "2014-03-21T16:46:29Z")

</div>

Generally this is related to Ansible somehow waiting for standard input, most commonly for a sudo or su password. I should note that I make this mistake _all the time_ .

I’d check to make sure that you haven’t set sudo: yes or su: yes somewhere in the playbooks that you’re running. If you have, make sure to set the --ask-sudo-pass, --ask-su-pass arguments on ansible-playbook or use the su\_pass, sudo\_pass keywords in your tasks.

Best of luck.
