Hello,
I would like to increase the timeout and retries for gather_facts. I tried already several things in the ansible.cfg, but without success so far.
What I tried:
[defaults]
inventory=inventory.test/
# library=library/
roles_path=~/.ansible/collections
filter_plugins=~/.ansible/collections
vault_password_file=vault_password.sh
collections_path=~/.ansible/collections
# timeout = 600
# task_timeout = 600
# https://docs.ansible.com/projects/ansible/latest/reference_appendices/config.html#default-hash-behaviour
hash_behaviour=merge
interpreter_python=auto_silent
stdout_callback=debug
stderr_callback=debug
# result_format=yaml
[inventory]
enable_plugins = cloud.terraform.terraform_provider, yaml
# [connection]
[ssh_connection]
# Docs: https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/ssh_connection.html
pipelining = True
password_mechanism = disable
ssh_common_args="-o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/dev/null -o ConnectTimeout=120"
# ssh_private_key_file=/run/secrets/ssh_privkey
private_key_file=/run/secrets/ssh_privkey
reconnection_retries = 60
timeout = 10
# ssh_args = -o ConnectTimeout=120
# retries=10
But geather_facts still exits after a few seconds.It usually takes a few minutes for the host to become available.
TASK [Gathering Facts] **********************************************************************************************************************************
[ERROR]: Task failed: Failed to connect to the host via ssh: ssh: connect to host 172.29.40.17 port 22: Connection refused
Task failed.
<<< caused by >>>
Failed to connect to the host via ssh: ssh: connect to host 172.29.40.17 port 22: Connection refused
fatal: [pve-test-1.ct1n.de]: UNREACHABLE! => {
"changed": false,
"unreachable": true
}
MSG:
Task failed: Failed to connect to the host via ssh: ssh: connect to host 172.29.40.17 port 22: Connection refused
How do I configure this correctly? Ansible.builtin.wait_for_connection / ansible.builtin.setup is my current workaround, but not the solution ![]()
Thanks a lot!
Thomas