[ansible-project] Re: ssh connection doesn't work
really ? just that ? I try with python installed in the managed machine And you know what ? It's work :) 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. Le dimanche 4 février 2018 17:22:52 UTC+4, Varun Chopra a écrit : > > You need to have Python installed on the managed host. > > On Sunday, February 4, 2018 at 6:22:54 PM UTC+5:30, jonatha...@clearsys.re > wrote: >> >> 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 -), >> 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 -v ansible-playbook command >> --- >> jrecly@debian:~/ansible$ ansible-playbook -i hosts playbook.yml - >> ansible-playbook 2.4.3.0 >> config file = /etc/ansible/ansible.cfg >> configured module search path = >> [u'/home/jrecly/.ansible/plugins/modules', >> u'/usr/share/ansible/plugins/modules'] >> ansible python module location = >> /usr/lib/python2.7/dist-packages/ansible >> executable location = /usr/bin/ansible-playbook >> python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2] >> Using /etc/ansible/ansible.cfg as config file >> setting up inventory plugins >> Parsed /home/jrecly/ansible/hosts inventory source with ini plugin >> Loading callback plugin default of type stdout, v2.0 from >> /usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc >> >> PLAYBOOK: playbook.yml >> *** >> 1 plays in playbook.yml >> >> PLAY [Securisation des serveurs] >> * >> >> TASK [Gathering Facts] >> *** >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/basic.py >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/__init__.py >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/namespace.py >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/ansible_collector.py >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/default_collectors.py >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/_text.py >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/convert_bool.py >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/__init__.py >> Using module_utils file >> /usr/lib/python2.7/dist-packages/ansible/module_utils/pycompat24.py >> Using module_utils file >>
[ansible-project] 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 -), 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 -v ansible-playbook command --- jrecly@debian:~/ansible$ ansible-playbook -i hosts playbook.yml - ansible-playbook 2.4.3.0 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/jrecly/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/dist-packages/ansible executable location = /usr/bin/ansible-playbook python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2] Using /etc/ansible/ansible.cfg as config file setting up inventory plugins Parsed /home/jrecly/ansible/hosts inventory source with ini plugin Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc PLAYBOOK: playbook.yml *** 1 plays in playbook.yml PLAY [Securisation des serveurs] * TASK [Gathering Facts] *** Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/basic.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/__init__.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/namespace.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/ansible_collector.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/default_collectors.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/_text.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/convert_bool.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/__init__.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/pycompat24.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/six/__init__.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/compat.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/timeout.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/collector.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/network/freebsd.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/virtual/openbsd.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/network/base.py Using module_utils file /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/hardware/dragonfly.py Using