Discussion:
[ansible-project] How to debug very simple hanging playbook
Olivier Lauret
2015-07-27 16:32:03 UTC
Permalink
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] ***@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
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/be92843c-9bd0-4317-bddc-22a84916ff90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Olivier Lauret
2015-07-28 10:13:16 UTC
Permalink
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
Post by Olivier Lauret
Hi all, I was wondering if there was away to debug a very simple playbook
when it is hanging.
- name: Install app on my servers
hosts: my_hosts
gather_facts: no
remote_user: my_user
su: yes
- app_install
#### app_install role (under tasks/main.yml)
- name: query whoami
shell: whoami
--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 <http://my_server.mydomain.com>> ESTABLISH
CONNECTION FOR USER: my_user on PORT 22 TO my_server.mydomain.com
<http://my_server.mydomain.com>*
*<my_server.mydomain.com <http://my_server.mydomain.com>> REMOTE_MODULE
command whoami #USE_SHELL*
*<my_server.mydomain.com <http://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 <http://my_server.mydomain.com>> PUT
/tmp/tmp6UGeFE TO
/tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/command*
*<my_server.mydomain.com <http://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
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/21a0df69-a645-4f90-9c0c-a58701f37ee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Brian Coca
2015-07-28 12:39:22 UTC
Permalink
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
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8k3xnFW5pO7xW3K63GpSaBr_DrsfU6OqLcfmBmqMu3i8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Olivier Lauret
2015-07-28 15:52:23 UTC
Permalink
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
Post by Olivier Lauret
/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
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6565b99b-65f1-4da1-bbdf-2a8ff7a7569f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Olivier Lauret
2015-07-29 21:10:26 UTC
Permalink
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
Post by Olivier Lauret
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
Post by Olivier Lauret
/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
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/eb2f0991-e499-45ff-8c0d-3b386ebfb0bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Olivier Lauret
2015-07-30 19:25:05 UTC
Permalink
Hi All,

I finally found the issue. It is related to the bug #9847
<https://github.com/ansible/ansible/issues/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
Post by Olivier Lauret
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
Post by Olivier Lauret
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
Post by Olivier Lauret
/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
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5210daf3-07d3-44cf-bc2d-2af4e6a3d63b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...