As I work for a software vendor, I have to wait for approval before I do
the pull request.

I have started that process, and as soon as I have it, I will share my work.

I have included the generated doc page to whet the appetite and explain
where i have got to.

On Fri, Oct 21, 2016 at 10:50 AM, Matt Davis <[email protected]> wrote:

> Yeah, I had that one on my list as a planned core module build for 2.3, so
> if you've got a decent start on one, let's see it!
>
> -Matt
>
>
> On Wednesday, October 19, 2016 at 1:52:20 AM UTC-7, jhawkesworth wrote:
>>
>> Hi,
>>
>> Definitely create a pull request, its the best way to get your code
>> reviewed by others (and the only way to get it included with ansible).
>> Definitely worth working your way through this if you haven't read it yet -
>> http://docs.ansible.com/ansible/developing_modules.html
>>
>> Also, please create one pull request per module.
>>
>> Many thanks.
>>
>> Jon
>>
>>
>>
>> On Tuesday, October 18, 2016 at 9:38:03 PM UTC+1, [email protected]
>> wrote:
>>>
>>> Hi,
>>>
>>> I have developed a Windows version of the wait_for module that mimics*
>>> part* of functionality of the Linux wait_for module.
>>>
>>> Currently my module is capable of the following:
>>>
>>>
>>>    - wait for the existence of a file (path parameter) when
>>>    state=present
>>>    - wait for a file (set by path parameter) to not exist when
>>>    state=absent
>>>    - wait for a file (set by path parameter) to contain a string
>>>    matching a regular expression (set by search_regex parameter)
>>>
>>>
>>> I would like to share this with the community to enable others to add
>>> more functionality and to reuse what i have done so far.
>>>
>>> Should I create a pull request to contribute this?
>>>
>>> Also, if i have multiple modules to share, should this be done in one
>>> pull request or multiple? Sorry for the dumb question but i am new to this
>>> :)
>>>
>>> Thanks
>>> Paul
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Development" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-devel/lLBvDmjsGEc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
## win_wait_for
Waits for a condition before continuing.

  * Synopsis
  * Options
  * Examples

#### Synopsis
 You can wait for a set amount of time (*timeout*), this is the default if (*name*) or (*path*) is not specified.
 This module can also be used to wait for a regex match a string to be present in a file (*search_regex*).
 This module can also be used to wait for a file to be available or absent on the filesystem.

#### Options

| Parameter     | required    | default  | choices    | comments |
| ------------- |-------------| ---------|----------- |--------- |
| name  |   no  |  | |  path to a file on the filesytem that must exist, or must be removed, before continuing. If not set, module will just wait for I(timeout) seconds. Alias for (*path*) parameter |
| delay  |   no  |  0  | |  number of seconds to wait before starting to poll. Must be less than I(timeout) value and must be zero or a positive integer  |
| state  |   |  | <ul> <li>present</li>  <li>absent</li> </ul> |  either ```present```, or ```absent```  When checking for a file or a search string ```present``` will ensure that the file or string is present before continuing, ```absent``` will check that file is absent or removed  |
| sleep  |   no  |  1  | |  Number of seconds between each check when dealing with files  |
| timeout  |   no  |  300  | |  maximum number of seconds to wait for before exiting. Must be a positive integer  |
| search_regex  |   no  |  | |  Can be used to match a string in a file. Defaults to a multiline regex.  |
| path  |   no  |  | |  path to a file on the filesytem that must exist, or must be removed, before continuing. If not set, module will just wait for (*timeout*) seconds. Alias for (*name*) parameter |


 
#### Examples

```

# just wait for 30 seconds
- win_wait_for: timeout=30

# just wait for 30 seconds - in this case, delay is ignored
- win_wait_for: timeout=30 delay=20

# wait for a file to exist, timeout after 10 minutes but don't perform first check for 1 minute
- win_wait_for: name='C:\Temp\somefile.txt' timeout=600 state=present delay=60

# wait for a file to be removed, wait 10 seconds between each check and timeout after 30 minutes
- win_wait_for: path='C:\Temp\somefile.txt' timeout=1800 state=absent sleep=10

# wait for a file to contain a line starting with Hello using default timeout of 5 minutes
- win_wait_for: path='C:\Temp\somefile.txt' search_regex='^Hello'

```


#### Notes

- This module does not implement all of the features of the M(wait_for) module.

- I(delay) parameter MUST be less than I(timeout) parameter or an error will be thrown

- When I(path) or I(name) is not provided, the I(delay) parameter is ignored so the total wait time is I(timeout).


---


---
Created by Network to Code, LLC
For: Paul Northrop
2016-10-21

Reply via email to