community.windows.win_wait_for_process – Waits for a process to exist or not exist before continuing.¶
This plugin is part of the community.windows collection (version 1.4.0).
To install it use:
ansible-galaxy collection install community.windows.
To use it in a playbook, specify:
Waiting for a process to start or stop.
This is useful when Windows services behave poorly and do not enumerate external dependencies in their manifest.
- name: Wait 300 seconds for all Oracle VirtualBox processes to stop. (VBoxHeadless, VirtualBox, VBoxSVC) community.windows.win_wait_for_process: process_name_pattern: 'v(irtual)?box(headless|svc)?' state: absent timeout: 500 - name: Wait 300 seconds for 3 instances of cmd to start, waiting 5 seconds between each check community.windows.win_wait_for_process: process_name_exact: cmd state: present timeout: 500 sleep: 5 process_min_count: 3
Common return values are documented here, the following are the fields unique to this module: