Ansible : ERROR! SSH encountered an unknown error during the connection

16 views
Skip to first unread message

nilesh bhadane

unread,
Apr 18, 2019, 5:01:05 PM4/18/19
to Ansible Project
Hi,

I am new the Ansible. I have setup ansible on Ubuntu machine as follows :

$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible .   ->> My machine don't have internet connection so this command didn't get executed
$ sudo apt-get install ansible

But machine show ansible is successfully installed

user@test-control-ansible:~$ ansible --version
ansible 2.0.0.2
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides


Then to verify I did simple ping test
I added target machine to ping to  hosts file, added key-gen etc (I followed some online tutorial)

user@test-control-ansible:~$ ansible -m ping test-servers

test-ansible.target.9307289.com | UNREACHABLE! => {

    "changed": false, 
    "msg": "ERROR! SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue", 
    "unreach



Is this a problem because it failed to add PPA repository? If yes, then how to add PPA repository on offline(no internet connection) machine
OR Is this any other issue?
Please help me.


Thanks,
Nilesh

Kai Stian Olstad

unread,
Apr 18, 2019, 5:20:13 PM4/18/19
to ansible...@googlegroups.com
On 18.04.2019 23:01, nilesh bhadane wrote:
> Hi,
>
> I am new the Ansible. I have setup ansible on Ubuntu machine as follows
> :
>
> $ sudo apt-get update
> $ sudo apt-get install software-properties-common
> $ sudo apt-add-repository --yes --update ppa:ansible/ansible . ->>
> *My
> machine don't have internet connection so this command didn't get
> executed*
> $ sudo apt-get install ansible
>
> But machine show ansible is successfully installed
>
> user@test-control-ansible:~$ ansible --version
> ansible 2.0.0.2
> config file = /etc/ansible/ansible.cfg
> configured module search path = Default w/o overrides

Because it installed the one in universe repo.
You can check with this command
apt-cache policy ansible

2.0 is very old and not recommended to use.


> Then to verify I did simple ping test
> I added target machine to ping to hosts file, added key-gen etc (I
> followed some online tutorial)
>
> user@test-control-ansible:~$ ansible -m ping test-servers
>
> test-ansible.target.9307289.com | UNREACHABLE! => {
>
> "changed": false,
> "msg": "ERROR! SSH encountered an unknown error during the
> connection.
> We recommend you re-run the command using -vvvv, which will enable SSH
> debugging output to help diagnose the issue",
> "unreach
>
>
>
> Is this a problem because it failed to add PPA repository?

No. You would need to do as the error message say to find more clues to
what is wrong.


> If yes, then how
> to add PPA repository on offline(no internet connection) machine
> OR Is this any other issue?

Download the deb from PPA manually and transfer it to the offline
machine and install it with "dpkg -i <some deb file>"


--
Kai Stian Olstad

nilesh bhadane

unread,
Apr 18, 2019, 5:31:10 PM4/18/19
to Ansible Project
I have just 1-day experience on Ansible. Can you please tell me what deb package I have to download & from where?

Kai Stian Olstad

unread,
Apr 18, 2019, 5:39:25 PM4/18/19
to ansible...@googlegroups.com
On 18.04.2019 23:31, nilesh bhadane wrote:
> I have just 1-day experience on Ansible. Can you please tell me what
> deb
> package I have to download & from where?

Without knowing your Ubuntu version that would be impossible.

--
Kai Stian Olstad

nilesh bhadane

unread,
Apr 18, 2019, 5:47:55 PM4/18/19
to Ansible Project

Its ubuntu version is xenial


user@test-conrol-ansible:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 16.04.6 LTS

Release: 16.04

Codename: xenial

Kai Stian Olstad

unread,
Apr 18, 2019, 5:53:19 PM4/18/19
to ansible...@googlegroups.com
On 18.04.2019 23:47, nilesh bhadane wrote:
> Its ubuntu version is xenial

This has nothing to do with Ansible since it's a generic Linux question,
but here goes.

The PPA is here
https://launchpad.net/~ansible/+archive/ubuntu/ansible

In the upper right corner you'll see a link "View package details", when
you click it you'll see a list of version.
Pressing on the link "ansible - 2.7.10-1ppa~xenial" under packages it
will open a page where you find the deb link in bottom.
The link is
https://launchpad.net/~ansible/+archive/ubuntu/ansible/+files/ansible_2.7.10-1ppa~xenial_all.deb

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages