EACHABLE cicd configuration_management ai_generated true

fatal: [host]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh", "unreachable": true}

ID: cicd/ansible-unreachable

Also available as: JSON · Markdown
85%Fix Rate
88%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

Ansible cannot reach the target host via SSH. Common causes include incorrect SSH credentials, network connectivity issues, host key verification failures, or the SSH service not running on the target.

generic

Workarounds

  1. 90% success Verify SSH connectivity manually and fix credentials
    Test SSH manually: ssh -vvv user@host. Check that the SSH key or password is correct, the host IP/DNS resolves, port 22 is open (nc -zv host 22), and the SSH service is running on the target.
  2. 85% success Configure ansible_ssh_common_args for bastion/jump host
    If the target is behind a bastion, set ansible_ssh_common_args='-o ProxyJump=bastion_user@bastion_host' in the inventory. Verify the bastion host is accessible first.

Dead Ends

Common approaches that don't work:

  1. Setting host_key_checking=False globally in production 70% fail

    This disables SSH host key verification entirely, creating a security vulnerability to MITM attacks. It also does not fix connectivity or credential issues.

  2. Increasing timeout values without investigating the root cause 85% fail

    If the host is genuinely unreachable (wrong IP, firewall, SSH not running), no amount of timeout increase will succeed — it just delays the failure

Error Chain

Leads to:
Preceded by:
Frequently confused with: