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.
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
Here is my backup.yml for my device[mikrotik]
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
Does the order matter?
I.e. if you shuffle them around does it consistently break after the 7th host?
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?
regardless of shuffling . as long as it reaches to 7 host the rest 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?
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 .
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.
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.
here is the system Im using on running with ansible. and no such applications are running in my machine.
and here is all the applications running in my machine
Is there no solution for this guys?
Are you using tacas for authentication?
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.
Can you try this in ansible.cfg?
[persistent_connection]
network_cli_retries = 5