---
title: "Discussion on \"How I audit 50 servers with one Ansible command\" | Hashnode"
description: "Discussion on \"How I audit 50 servers with one Ansible command\". How I audited 50 simulated servers with one Ansible command, the code behind it, and the bugs that taught me the most"
url: "https://hashnode.com/posts/how-i-audit-50-servers-with-one-ansible-command/6ad611c20cc776befc115c60"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How I audit 50 servers with one Ansible command](https://codewithniji.hashnode.dev/how-i-audit-50-servers-with-one-ansible-command?utm_source=hashnode&utm_medium=feed)

How I audited 50 simulated servers with one Ansible command, the code behind it, and the bugs that taught me the most

Oct 19 · 12 min read · codewithniji.hashnode.dev  
Read the article

-   [#ansible](https://hashnode.com/tag/ansible)
-   [#devops](https://hashnode.com/tag/devops)
-   [#sre](https://hashnode.com/tag/sre)
-   [#automation](https://hashnode.com/tag/automation)
-   [#linux](https://hashnode.com/tag/linux)

## Written by

[Opeyemi Adeniji](https://hashnode.com/@niji)

@niji · Dublin, Ireland

  
[View profile](https://hashnode.com/@niji)

DevOps and SRE projects, built in public

I build and document hands-on DevOps and SRE projects. Each post covers what I built, how it works, and what went wrong along the way. Current series: Ansible, Packer, AWS, Terraform and Kubernetes. Code is on GitHub.

## Responses 4

Markdown supported · ⌘↵ to post

[Abhinav Sharma](https://hashnode.com/@abhinavs1920)

[Oct 19](https://hashnode.com/posts/how-i-audit-50-servers-with-one-ansible-command/6ad611c20cc776befc115c60/comment/6ad6158bee25e2c8dd016a07)

"An unreachable server is a result, not a crash" is the line that separates an audit from a health check - the box that doesn't answer is usually the one that matters most. changed\_when: false is the other honest touch: nothing is worse than a read-only run that shows 50 "changed". Of the five problems you hid, which did the report rank highest, and did any hide below ones that only looked worse?

[Opeyemi Adeniji](https://hashnode.com/@niji)

[Oct 19](https://hashnode.com/posts/how-i-audit-50-servers-with-one-ansible-command/6ad611c20cc776befc115c60/comment/6ad6158bee25e2c8dd016a07#reply-6ad61d7a224b96cf6be37708)

Thanks Abhinav, glad those two lines landed. The report ranked db-02 (UNREACHABLE) first, then the three CRIT hosts, then the WARN, then OK. So nothing hid below something worse across levels. Within a level, though, the order is only alphabetical, so web-07 (disk 92% full) sits below app-11 (app server down) because “app” sorts first, not because the report judged it less severe. That’s a limitation. A better version would rank inside each level by number of issues or by weight (service down above a nearly full disk). Good question, it’s going on my list for the next release.

[Abhinav Sharma](https://hashnode.com/@abhinavs1920)

[Oct 19](https://hashnode.com/posts/how-i-audit-50-servers-with-one-ansible-command/6ad611c20cc776befc115c60/comment/6ad6158bee25e2c8dd016a07#reply-6ad63f7ba0423f80f5c84c08)

Alphabetical within a level is a fine v1 - at least it's predictable. The weighting gets interesting fast though: "app server down" outranks "disk 92%" until the disk hits 100 and takes the app down with it. You're really ranking time-to-page, not severity. Curious what you land on.

[Opeyemi Adeniji](https://hashnode.com/@niji)

[Oct 19](https://hashnode.com/posts/how-i-audit-50-servers-with-one-ansible-command/6ad611c20cc776befc115c60/comment/6ad6158bee25e2c8dd016a07#reply-6ad69e455814e37c46752335)

Thank you Abhinav. "Time-to-page, not severity" is a much better way to put it than the way I had described it. You are right that the current report is a snapshot so it can see that a disk is at 92 percent but it cannot tell how fast that disk is filling. The tool already saves a timestamped report on every run so I can use those earlier runs to estimate how long each disk has until it is full and rank hosts by that estimate. I will share what I land on in the next version.
