[Errno 110] Connection timed out with multiple ssh in router

526 views
Skip to first unread message

Vincent Nambatac

unread,
Jul 6, 2021, 8:39:39 AM7/6/21
to Ansible Project

Im having a trouble in getting config with 30 plus routers . I can ssh and get configs but the problem is , it is limited only with 7 ssh connections . how can I fix this issue ? i added already command time out and persistent connection  but still problem persist. how can I solve this issue? Thanks in advance.

Vincent Nambatac

unread,
Jul 6, 2021, 9:00:13 AM7/6/21
to Ansible Project
Here is my Ansible.cfg file, I did set the command time out but then only the maximmum ssh I get is 7 ssh connections only . Im wondering if this is something to deal with forks. please help about this issue .

# config file for ansible -- https://ansible.com/
# ===============================================
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first
[defaults]
# some basic default values...
inventory = ./hosts
# set 7 forks for successful first 7
forks = 30

interpreter_python = /usr/bin/python3
# uncomment this to disable SSH key host checking
host_key_checking = False
# retry files
# When a playbook fails a .retry file can be created that will be placed in ~/
# You can enable this feature by setting retry_files_enabled to True
# and you can change the location of the files by setting retry_files_save_path
deprecation_warnings = False
retry_files_enabled = False

[persistent_connection]
command_timeout = 1200
#connect_retry_timeout = 300


Vincent Nambatac

unread,
Jul 6, 2021, 9:01:25 AM7/6/21
to Ansible Project
Here is my backup.yml for my device[mikrotik]


---
- name: AUTOMATIC BACKUP OF RUNNING-CONFIG FOR MIKROTIK
hosts: makati_routers
connection: network_cli
gather_facts: false
tasks:
- name: DISPLAYING THE RUNNING-CONFIG
community.routeros.command:
commands:
- /export
register: config

- name: SAVE OUTPUT TO ./backups/
copy:
content: "{{ config.stdout[0] }}"
dest: "./backups/{{ inventory_hostname }}-config.txt"

Vincent Nambatac

unread,
Jul 6, 2021, 9:05:24 AM7/6/21
to Ansible Project
Here, there are 8 devices I set for the initial ssh. but then only 7 ssh connections are successful. the rest are failed.note that all the devices are accessible via ssh I tested my 30 devices manually to ensure they are all accessible but when running in ansible it only reaches to 7 connections. please help
Screenshot from 2021-07-06 21-02-32.png

Dick Visser

unread,
Jul 6, 2021, 9:24:22 AM7/6/21
to ansible...@googlegroups.com
Does the order matter?
I.e. if you shuffle them around does it consistently break after the 7th host?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8e506f93-e21e-4cf0-a12c-f563eaf677e1n%40googlegroups.com.


--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

Vincent Nambatac

unread,
Jul 6, 2021, 9:27:53 AM7/6/21
to Ansible Project
Thanks for your response , Yes I tried to shuffle them . but then one of those will get error connection time out . is there something I can tweak in the ansible.cfg side?

Vincent Nambatac

unread,
Jul 6, 2021, 9:28:38 AM7/6/21
to Ansible Project
regardless of shuffling . as long as it reaches to 7 host the rest will get error connection time out.

Dick Visser

unread,
Jul 6, 2021, 9:39:44 AM7/6/21
to ansible...@googlegroups.com
On Tue, 6 Jul 2021 at 15:28, Vincent Nambatac <nambata...@gmail.com> wrote:
>
> Thanks for your response , Yes I tried to shuffle them . but then one of those will get error connection time out .

This doesn't really answer my question.
Can you confirm that the order does NOT matter, and that the 8th
system will ALWAYS timeout - no matter what system it is?

Vincent Nambatac

unread,
Jul 6, 2021, 9:43:59 AM7/6/21
to Ansible Project
alright i get it . the connection time out is not consistent only from the last system[8th] . any of those 8 are getting the error connection time out . 

Vincent Nambatac

unread,
Jul 6, 2021, 9:46:16 AM7/6/21
to Ansible Project
The order that doesn't matter at all . and yeah the 8th system will ALWAYS time out no matter what system it is .

Antony Stone

unread,
Jul 6, 2021, 9:54:04 AM7/6/21
to ansible...@googlegroups.com
On Tuesday 06 July 2021 at 15:46:16, Vincent Nambatac wrote:

> The order that doesn't matter at all . and yeah the 8th system will ALWAYS
> time out no matter what system it is .

Are you able to create 8 simultaneous SSH sessions _manually_ (so, just using
the standard command-line SSH client, not ansible) from the machine you are
running ansible on:

a) to these specific routers

b) to anywhere else at all?


Antony.

--
How does an Israeli man make tea? Hebrews it.

Please reply to the list;
please *don't* CC me.

Vincent Nambatac

unread,
Jul 6, 2021, 10:02:12 AM7/6/21
to Ansible Project
Yes, I got 30 routers and I've done having  SSH all of them, all are accessible via manual SSH .
a. to these specific routers
-- yes all routers are accessible via manual ssh
b. to anywhere else at all
-- the error is not only consistent with 1 system it is anywhere else at all as long the system reach 8th it will fail . for example router1 fails at first run , and then the second run router 3 will fail but router 2 is ok . it is not consistent .

Antony Stone

unread,
Jul 6, 2021, 10:12:59 AM7/6/21
to ansible...@googlegroups.com
On Tuesday 06 July 2021 at 16:02:12, Vincent Nambatac wrote:

> Yes, I got 30 routers and I've done having SSH all of them, all are
> accessible via manual SSH .
> a. to these specific routers
> -- yes all routers are accessible via manual ssh
> b. to anywhere else at all
> -- the error is not only consistent with 1 system it is anywhere else at
> all as long the system reach 8th it will fail . for example router1 fails
> at first run , and then the second run router 3 will fail but router 2 is
> ok . it is not consistent .

So, if I understand you correctly, you can only make 7 simultaneous SSH
connections from the ansible server to anything at all (these routers, or to
other systems), and the 8th attempt will fail.

Please can you tell us more about the machine you are running ansible on?

What operating system and version?

How much memory?

Is it running any other significant applications (apache, exim, icinga, etc)?

Anything else you think might be helpful for us to know about it?


Antony.

--
Atheism is a non-prophet-making organisation.

Vincent Nambatac

unread,
Jul 6, 2021, 10:23:12 AM7/6/21
to Ansible Project
here is the system Im using on running with ansible. and no such applications are running in my machine.

Screenshot from 2021-07-06 22-20-33.png

and here is all the applications running in my machine

Screenshot from 2021-07-06 22-22-44.png

Vincent Nambatac

unread,
Jul 6, 2021, 10:25:03 AM7/6/21
to Ansible Project
and also Im running at an ubuntu OS, here is the ram on my machine as well.

Screenshot from 2021-07-06 22-24-27.png

Vincent Nambatac

unread,
Jul 7, 2021, 8:42:11 PM7/7/21
to Ansible Project


Is there no solution for this guys?

rajthecomputerguy

unread,
Jul 7, 2021, 9:37:40 PM7/7/21
to Ansible Project
Are you using tacas for authentication?

Vincent Nambatac

unread,
Jul 7, 2021, 9:58:20 PM7/7/21
to Ansible Project
Hi rajthecomputerguy, what do you mean by tacas? I got no problem with authentication. only with connection time out. I got 10 routers . only 7 devices can ssh successfully. and that 7 devices are not constant devices. any of the 10 devices can be ssh using manually. but in ansible I can ssh only 7. please please I am having trouble about this week ago till now no solution.

rajthecomputerguy

unread,
Jul 8, 2021, 2:39:07 AM7/8/21
to Ansible Project
Can you try this in ansible.cfg?

[persistent_connection] 
network_cli_retries = 5

Reply all
Reply to author
Forward
0 new messages