What does `ansible all -m ping` actually test?
BeginnerConceptAd-hoc Commands, Modules and Idempotency
Answer
It is not an ICMP ping. The ping module logs in over SSH, runs a tiny Python module on the target, and returns pong. A SUCCESS therefore proves four things: network reachability, SSH authentication, a working Python interpreter, and that a temp directory can be written.
An UNREACHABLE! points to network/SSH/auth, while a module failure with "interpreter not found" points to Python.
More on Ad-hoc Commands, Modules and Idempotency
What is an ad-hoc command and what is its syntax?BeginnerGive practical use cases for ad-hoc commands.IntermediateWhat is the difference between the `command` and `shell` modules?BeginnerCompare `raw`, `command`, `shell` and `script`.IntermediateWhy prefer a dedicated module over `shell`/`command`?BeginnerWhat is idempotency and why does it matter?Beginner