The ping module

Not all Ansible modules work with Windows hosts and ping is one of them. There is a module provided for Windows called win_ping and we will be using that here.

The command we need to run follows; as you can see, other than the module name it is exactly the way we executed it against a Linux host:

$ ansible windows -i production -m win_ping

If you are a macOS user and you receive an error like this one, then don't worry; there is a workaround for it:

The error is a known issue that is being worked on by the Ansible team. In the meantime, run the following command, or add it to your ~/.bash_profile file:

$ export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.