How to debug very simple hanging playbook

147 views
Skip to first unread message

Olivier Lauret

unread,
Jul 27, 2015, 12:32:04 PM7/27/15
to Ansible Project
Hi all, I was wondering if there was away to debug a very simple playbook when it is hanging.


### Playbook:
- name: Install app on my servers
  hosts: my_hosts
  gather_facts: no
  remote_user: my_user
  su: yes

  roles:
  - app_install


#### app_install role (under tasks/main.yml)
- name: query whoami
  shell: whoami


It always hangs at the this level:

[PROJECT] myotheruser@myprodserver# ansible-playbook -i hosts -k --ask-su-pass my_playbook.yml -vvvv
SSH password:
SU password[defaults to SSH password]:

PLAY [Install app on my servers] ************************************

TASK: [app_install | query whoami] ***
<my_server.mydomain.com> ESTABLISH CONNECTION FOR USER: my_user on PORT 22 TO my_server.mydomain.com
<my_server.mydomain.com> REMOTE_MODULE command whoami #USE_SHELL
<my_server.mydomain.com> EXEC /bin/sh -c 'mkdir -p /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733 && chmod a+rx /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733 && echo /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733'
<my_server.mydomain.com> PUT /tmp/tmp6UGeFE TO /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/command
<my_server.mydomain.com> EXEC /bin/sh -c 'su root -c "/bin/sh -c '"'"'echo BECOME-SUCCESS-xzmbgooensxgrlbezhnlngbagojwbczg; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/command; rm -rf /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/ >/dev/null 2>&1'"'"'"'


And nothing else!

Ping works on this server.

Any idea?

Regards,
Olivier

Olivier Lauret

unread,
Jul 28, 2015, 6:13:16 AM7/28/15
to Ansible Project, olivier...@googlemail.com
Hello all,

The problem still persists but I have more information:

  • Ansible version: ansible 1.9.1
  • Everything works if I am NOT using "su"
  • I can run manually on the server the last ansible command displayed in my log.
  • The password prompt is "Password:"
  • Gather facts works fine
  • Python 2.6.6
  • Linux machine

Is it something related to the "Password:" prompt? How to find this out?


Regards,

Olivier

Brian Coca

unread,
Jul 28, 2015, 8:39:25 AM7/28/15
to Ansible Project, olivier...@googlemail.com
try logging onto the machine and run this by hand:

/bin/sh -c 'su root -c "/bin/sh -c '"'"'echo
BECOME-SUCCESS-xzmbgooensxgrlbezhnlngbagojwbczg; LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8 /usr/bin/python
/tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/command;
rm -rf /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/
>/dev/null 2>&1'"'"'"'



--
Brian Coca

Olivier Lauret

unread,
Jul 28, 2015, 11:52:23 AM7/28/15
to Ansible Project, bc...@ansible.com
Hello Brian,

Thank you for your answer. I have tried that and it is working fine. Thisi is reference to the "Password:" I mentioned earlier.

The problem seems to be related to the version of ansible. It is working fine in 1.6.10 but not in 1.9.1

I am testing now the latest stable version (1.9.2-1).

Regards,
Olivier

Olivier Lauret

unread,
Jul 29, 2015, 5:10:26 PM7/29/15
to Ansible Project, bc...@ansible.com, olivier...@googlemail.com
Hi All,

I have tested the latest version and I have the same behaviour. So, so far , only works in 1.6.10. I guess, this is a regression.

Regards,
Olivier

Olivier Lauret

unread,
Jul 30, 2015, 3:25:05 PM7/30/15
to Ansible Project, bc...@ansible.com, olivier...@googlemail.com
Hi All,

I finally found the issue. It is related to the bug #9847. If the user doesn't have a home folder assign, we have this issue. The workaround is pretty easy and well explained in the bug report. Thank you @arlinton and Brian for your help.

Regards,
Olivier
Reply all
Reply to author
Forward
0 new messages