Skip to content

Instantly share code, notes, and snippets.

View RustyNails8's full-sized avatar
:electron:

Sumit Das RustyNails8

:electron:
View GitHub Profile
@dmccuk
dmccuk / ansible_failed_hosts.md
Last active June 6, 2025 17:18
For when you need Ansible to give you a list of unreachable or failed hosts

How to get a list of failed or unreachable hosts

This is in response to this stackoverflow question The solution was posted by Vladimir Botka.

  • YouTube walkthough here

When Ansible runs, it's great for setting up and configuring servers as per your playbooks and roles. But have you ever needed to collect a list of failed hosts where Ansible wasn't able to connect to them? In this demo I'm going to show you how to collect a list of failed and unreachable hosts.

My setup:

I'm simply using a list of servers that don't exist, along with one remote server that I can get to.