Ansible Pilot

Test Windows host availability - Ansible module win_ping

Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons

Deep dive into the Ansible module win_ping in the collection to test the access to a managed Windows host and that that there is a shell usually PowerShell available. Live demo and Ansible playbook included.

How to test Windows host availability?

Today we’re going to talk about the simplest way to test if a Windows-managed host is available to receive our commands. I’m Luca Berton and welcome to today’s episode of Ansible Pilot.

Ansible module win_ping

Today we’re talking about Ansible module win_ping. The full name is, which means that is part of the collection of the “windows” modules of ansible. Previously was part of the built-in collection. It’s a module pretty stable and out for years. It verifies the ability of Ansible to login to the managed host and that there is a shell, usually PowerShell, that is able to execute our code. So it’s pretty different for the ping in the network context. It’s the Windows corresponding to the Ansible ping module.

Main Parameters

Main Return Values

People usually don’t specify any parameters or use the return value. The win_ping module usually delivers the pong text to the endpoint. It’s possible to personalize the text using the “data” parameter. The return value is the “ping” string, that contains the same string of the data input parameter. If we keep the default value we are going to use “pong” as a parameter and as the return value.


Are you ready to make your hands dirty? Let’s jump in a quick live demo of a playbook about the win_ping module.

- name: win_ping module demo
  hosts: all
  become: false
  gather_facts: false
    - name: test connection

code with ❤️ in GitHub


Now you know better the Ansible module win_ping and you could use it successfully in your playbook. Subscribe to the YouTube channel, Medium, Website and Twitter to not miss the next episode of the Ansible Pilot.


Learn the Ansible automation technology with some real-life examples in my

My book Ansible By Examples: 100+ Automation Examples For Linux and Windows System Administrator and DevOps

Access the Complete Book and Learn Quick Ansible by 200+ Examples

Want to keep this project going? Please donate

Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons
Follow me

Subscribe not to miss any new releases

August 20, 2021

FREE Top 10 Best Practices

Top 10 Best Practices of Ansible Automation: save time, reduce errors and stress