# win\_domain, win\_reboot, what to wait or test\_command for?

**URL:** <https://forum.ansible.com/t/win-domain-win-reboot-what-to-wait-or-test-command-for/31223>\
**Category:** Ansible Project\
**Created:** [September 8, 2019, 2:53am UTC](https://forum.ansible.com/t/win-domain-win-reboot-what-to-wait-or-test-command-for/31223 "2019-09-08T02:53:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [September 8, 2019, 2:53am UTC](https://forum.ansible.com/t/win-domain-win-reboot-what-to-wait-or-test-command-for/31223/1 "2019-09-08T02:53:04Z")

</div>

When making a domain in ansible, ive been a playbook like this,

`

- hosts: domaincontrollers[0]  
tasks:

- name: make the domain  
win\_domain:  
dns\_domain\_name: foo.local  
safe\_mode\_password: A1!vagrant  
register: check\_domain

- name: Reboot to complete domain setup  
win\_reboot:  
test\_command: ‘exit (Get-Service -Name Netlogon).Status -ne “Running”’  
post\_reboot\_delay: 600  
when: check\_domain.changed

- name: Make a domain admin  
win\_domain\_user:  
name: dom  
upn: dom@foo.local  
password: A1!vagrant  
groups:

- Domain Admins

`

The example test command doesnt wait long enough and says the domain doesnt exist when i try to add a user. the console just says “applying settings” and it wont work till thats done. So what should i test for?
