I'm getting permission error on basic ansible ping command. I verified ssh to remote hostname and ip address so the ssh host key is not an issue. Using CentOS7.0
If I cut/paste ssh command in ansible debug, the output will indicate I don't have access privilege to control path under /root. I wonder why Ansible use default root path while I'm executing ansible from sudo user test. [test@hjma291 ~]$ sudo ansible apacheweb -m ping -vvvv ESTABLISH CONNECTION FOR USER: test REMOTE_MODULE ping EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=test -o ConnectTimeout=10 hjma292.mylabserver.com /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1453489009.17-230968962314359 && echo $HOME/.ansible/tmp/ansible-tmp-1453489009.17-230968962314359' hjma292.mylabserver.com | FAILED => SSH Error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). while connecting to 54.201.99.23:22 It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue. [test@hjma291 ~]$ debug1: read PEM private key done: type RSA debug1: Enabling compression at level 6. debug1: Authentication succeeded (publickey). Authenticated to hjma292.mylabserver.com ([54.201.99.23]:22). debug1: setting up multiplex master socket debug3: muxserver_listen: temporary control path /root/.ansible/cp/ansible-ssh-hjma292.mylabserver.com-22-test.UbB3i3qWanC8UnC8 muxserver_listen bind(): Permission denied If I change ansible.conf file to "ssh_args = ", then I still get the same error but from detailed debug. Now ssh can log in but I'm getting "mkdir: missing operand" error after that. [test@hjma291 ~]$ sudo ansible apacheweb -m ping -vvvv [sudo] password for test: ESTABLISH CONNECTION FOR USER: test REMOTE_MODULE ping EXEC ssh -C -tt -vvv -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=test -o ConnectTimeout=10 hjma292.mylabserver.com /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1453488871.65-81648312932876 && echo $HOME/.ansible/tmp/ansible-tmp-1453488871.65-81648312932876' hjma292.mylabserver.com | FAILED => SSH Error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). while connecting to 54.201.99.23:22 It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue. [test@hjma291 ~]$ debug1: Sending command: /bin/sh -c mkdir -p $HOME/.ansible/tmp/ansible-tmp-1453489565.68-118702701632351 && echo $HOME/.ansible/tmp/ansible-tmp-1453489565.68-118702701632351 debug2: channel 0: request exec confirm 1 debug2: callback done debug2: channel 0: open confirm rwindow 0 rmax 32768 debug2: channel_input_status_confirm: type 99 id 0 debug2: PTY allocation request accepted on channel 0 debug2: channel 0: rcvd adjust 2097152 debug2: channel_input_status_confirm: type 99 id 0 debug2: exec request accepted on channel 0 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0 debug2: channel 0: rcvd eow debug2: channel 0: close_read debug2: channel 0: input open -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: rcvd close debug3: channel 0: will not send data after close mkdir: missing operand Try 'mkdir --help' for more information. debug3: channel 0: will not send data after close debug2: channel 0: obuf empty -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b77290d2-8c6d-46d2-8044-c53a0823d1a1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
