Paul, I did resolve it by using the following workaround:

First of all I searched for a Windows Service in the target host that was 
not used (it was in the manual status) and in case it would be started, 
then it should use a certain port for listening. With Ansible:

- I scheduled a Windows job that was "looking for the condition to fulfill" 
on the target host. The job was running every couple of minutes. Once it 
was so far, the scheduled job was going to start a windows service, which 
was listening to a certain port. After the Windows service has started, the 
scheduled job had finally to delete "itself" from the scheduled jobs on the 
target host
- I was using this port number of the Windows service in the wait_for

My Ansible playbook had to reboot the target host anyway at the end. The 
Windows service I "misused" for the "wait_for" was not running after the 
reboot, so everything was "clean" again.

Hope it helps,
Stavros


On Thursday, June 8, 2017 at 5:48:18 PM UTC+2, Paul Farrington wrote:
>
> Stavros, did you ever get this resolved as i have this exact issue now.
>
> On Wednesday, 10 February 2016 16:35:04 UTC, Stavros wrote:
>>
>> Hi,
>>
>> I use the wait_for in a playbook in order to wait until a file is 
>> present, but this doesn't work, e.g.
>>
>>      - name: Wait for remote host
>>        wait_for: host={{ floating_ip }} path="C:\\Temp\\status.txt" 
>> state=present
>>
>> When I use the wait_for module for the winrm port, then it works fine:
>>
>>      - name: Wait for remote host
>>        wait_for: host={{ floating_ip }} port=5986 state=started
>>
>>
>> Any idea, how to wait in Windows for a file until it is present?
>>
>>
>> Thanks in advance!
>>
>> KR,
>> Stavros
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a3303b1c-5fba-452e-bf64-17822ae490f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to