AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,100 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example" published by Apress, and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Fix Ansible "UNREACHABLE" Error: Host Connection Troubleshooting

By Luca Berton · Published 2024-01-01 · Category: installation

How to fix Ansible UNREACHABLE error. Troubleshoot SSH connectivity, timeout, wrong port, firewall issues. Complete diagnosis and fix guide.

Fix Ansible "UNREACHABLE" Error: Host Connection Troubleshooting

The UNREACHABLE! error means Ansible cannot connect to a host via SSH. Here's how to diagnose and fix it.

Common Causes and Fixes

1. Wrong SSH Credentials

2. SSH Port is Not 22

3. Host Key Verification Failed

4. Firewall Blocking SSH

5. DNS Resolution Failure

6. SSH Timeout

Debugging Steps

FAQ

What does UNREACHABLE mean in Ansible?

UNREACHABLE means Ansible's SSH connection to the host failed. The host may be down, the SSH port may be blocked, credentials may be wrong, or a network issue prevents connectivity.

How do I fix UNREACHABLE errors? Verify the host is up: ping hostname Test SSH manually: ssh user@hostname Check inventory settings (host, port, user, key) Increase timeout in ansible.cfg Run with -vvvv for detailed error output

How do I skip unreachable hosts?

Use --forks 1 to process sequentially, or set ignore_unreachable: true on tasks that should continue despite unreachable hosts.

Related ArticlesInstall Ansible: Complete GuideAnsible Configuration Guide

Category: installation

Browse all Ansible tutorials · AnsiblePilot Home