ssh connection doesn't work

Hi everybody,

I have some problems to use ansible.

I use ansible version 2.4.3.0 i

I testing just one host with IP and port (I have port fowarding).
I copying ssh pub key (ssh-copy-id).
I try to install Git on the target serveur.

tasks:

  • name: Installation de Git
    apt: name=git update_cache=yes

When I lauch ansible (ansible-playbook -i hosts playbook.yml -vvvvvvvv), I have this message error :

OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 5417\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 165.169.240.98 closed.\r\n",
“module_stdout”: “/bin/sh: 1: /usr/bin/python: not found\r\n”

But if I lauch ansible ssh command in the terminal (just copy and paste ansible ssh command : ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o Port=2211 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/jrecly/.ansible/cp/d29cd310c0 -tt 165.169.240.98), connection wil be establish normaly

here the result of the -vvvvv ansible-playbook command

You need to have Python installed on the managed host.

really ? just that ?

I try with python installed in the managed machine … And you know what ? It’s work :slight_smile:

Thanks very much for your help. I pass two day to search on internet solution, and you save me with this simply response.

Have a good day and thanks again.