Totally Stuck...

148 views
Skip to first unread message

Tiglath

unread,
Sep 29, 2014, 3:31:36 PM9/29/14
to ansible...@googlegroups.com
 
 
 
This is a real blocker.    SSH works but Ansible does not.
 
 
In the debug output I see  ''PasswordAuthentication=no' and that looks wrong.  
 
Any ideas?  
 
Thanks
 
-------------
 
$: ssh -t venus "mkdir /tmp/core; cd /tcp; sudo mv /tmp/core ." 2>/dev/null

Password: <pwd>

No problem. 

--------------------------------------

$:  ansible venus -vvvv -i hosts -m shell -a "mkdir /tmp/core; cd /tcp; sudo mv /tmp/core ." --sudo -K

sudo password: <pwd>

<venus> ESTABLISH CONNECTION FOR USER: user

<venus> REMOTE_MODULE command mkdir /tmp/core; cd /tcp; sudo mv /tmp/core . #USE_SHELL

<venus> EXEC ['ssh', '-C', '-vvv', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', 'venus', u'/bin/sh -c "sudo -k && sudo -H -S -p \\"[sudo via ansible, key=rcqlyohwnuyvwjzysaxnqqcdokwhgfok] password: \\" -u root /bin/bash -c \'echo SUDO-SUCCESS-rcqlyohwnuyvwjzysaxnqqcdokwhgfok; LC_CTYPE=C LANG=C /usr/bin/python\'"']

venus | FAILED => ssh connection error waiting for sudo or su password prompt

Timothy Gerla

unread,
Sep 29, 2014, 3:37:25 PM9/29/14
to ansible-project

--------------------------------------

$:  ansible venus -vvvv -i hosts -m shell -a "mkdir /tmp/core; cd /tcp; sudo mv /tmp/core ." --sudo -K

sudo password: <pwd>


Looks like you are asking to be prompted for a sudo password ('-K') but not an SSH password ('-k') -- so it's not going to be trying for password auth.

-Tim
--

Tiglath

unread,
Sep 29, 2014, 3:56:48 PM9/29/14
to ansible...@googlegroups.com

Thank you for your reply.
 
I did not explain myself too well.  Sorry.
 
I don't need SSH authentication, only sudo. 
 
So we have two authentications.  SSH proceeds without password using keys, but sudo needa a password, which I give at the prompt. 
 
What other password is it waiting for, as mentioned in the error message?   

Adam Heath

unread,
Sep 29, 2014, 4:04:43 PM9/29/14
to ansible...@googlegroups.com
You can't call sudo from the shell module.

The play would normal be like this:

....
tasks:
....
- name: foo
sudo: true
sudo_user: root
file: state=directory dest=/tcp/core
....
> t...@gerla.net <javascript:>
>
> --
> 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-proje...@googlegroups.com
> <mailto:ansible-proje...@googlegroups.com>.
> To post to this group, send email to ansible...@googlegroups.com
> <mailto:ansible...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/12ac254d-f4bd-407d-ad46-509e9a33e2c1%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/12ac254d-f4bd-407d-ad46-509e9a33e2c1%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Tiglath

unread,
Oct 2, 2014, 5:20:50 PM10/2/14
to ansible...@googlegroups.com
Thank you for your time. 
 
 
I followed your syntax, same results.   Bummer.
 
command:
 

ansible-playbook -K -vvvv -i hosts apps/tcpredirector/deploy2.yml

 
Playbook:
 
---
- hosts: sslmioq
  tasks:

      - name: Create directories.
        sudo: true
        sudo_user: root
        file: state=directory dest=/export/home/ltv-r12/boo
 
PLAY [sslmioq] ****************************************************************
 
GATHERING FACTS ***************************************************************
<sslmioq> ESTABLISH CONNECTION FOR USER: jsuriol
<sslmioq> REMOTE_MODULE setup
<sslmioq> EXEC ['ssh', '-C', '-vvv', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', 'sslmioq', u"/bin/bash -c 'LC_CTYPE=C LANG=C /usr/bin/python'"]
ok: [sslmioq]
 
TASK: [Create directories.] ***************************************************
<sslmioq> ESTABLISH CONNECTION FOR USER: jsuriol
<sslmioq> REMOTE_MODULE file state=directory dest=/home/ltv-r12/boo
<sslmioq> EXEC ['ssh', '-C', '-vvv', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', 'sslmioq', u'/bin/sh -c "sudo -k && sudo -H -S -p \\"[sudo via ansible, key=vrkqqqyqkpdlhhpoebrwtlxjgdwtcwix] password: \\" -u root /bin/bash -c \'echo SUDO-SUCCESS-vrkqqqyqkpdlhhpoebrwtlxjgdwtcwix; LC_CTYPE=C LANG=C /usr/bin/python\'"']
fatal: [sslmioq] => ssh connection error waiting for sudo or su password prompt
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
           to retry, use: --limit @/export/home/jsuriol/deploy2.retry
sslmioq                    : ok=1    changed=0    unreachable=1    failed=0
Reply all
Reply to author
Forward
0 new messages