seeking help with problem when using gather_facts

128 views
Skip to first unread message

Zack May

unread,
Jan 21, 2022, 3:57:27 PM1/21/22
to Ansible Project
I'm hoping someone can help me figure out what is going on within my ansible environment.  When I try and use gather_facts inside a playbook I get a failure to connect over ssh to that system.  However, if I do not gather_facts the playbook will run.  The error I am getting is below.  Has anyone dealt with this in the past, and if so could you help me figure out what is going on?

Thanks

Zack

fatal: [server]: UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: OpenSSH_8.2p1 Ubuntu-4ubuntu0.4, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /home/me/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 2.2.2.2 is address\r\ndebug2: ssh_connect_direct\r\ndebug1: Connecting to 2.2.2.2 [2.2.2.2] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: connect to address 2.2.2.2 port 22: Connection timed out\r\nssh: connect to host 2.2.2.2 port 22: Connection timed out",
    "unreachable": true
}

version details:
ansible [core 2.12.1]
  config file = /home/me/ansible/ansible.cfg
  configured module search path = ['/home/me/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /home/me/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
  jinja version = 3.0.3
  libyaml = True

Oleg Galushko

unread,
Jan 21, 2022, 4:11:41 PM1/21/22
to Ansible Project
Do you tried add/increase timeout or gather timeout value in your ansible.cfg?

пятница, 21 января 2022 г. в 23:57:27 UTC+3, za...@varnish-software.com:

Evan Hisey

unread,
Jan 22, 2022, 12:47:12 PM1/22/22
to Ansible Project
IS the address really 2.2.2.2? and can you show a the playbook?
Reply all
Reply to author
Forward
0 new messages