[ansible-project] Re: win_scheduled_task : run the scheduled task every minute

2018-02-16 Thread ktesr123456
Thanks Jordan i will go ahead with your suggestion

On Thursday, February 15, 2018 at 4:11:34 PM UTC-5, Jordan Borean wrote:
>
> Not in any easy idempotent way unfortunately, you have some options, you 
> could;
>
> * Use win_command/win_shell to create the task but the COM API used can 
> get quite complex and dealing with idempotency would be difficult
> * You can copy the newer version of the module 
> https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/windows/win_scheduled_task.ps1
>  
> to a directory called library and use it like you would when 2.5 is out. It 
> is best to name the module with a special suffix so you know that it is a 
> custom version and not the builtin module used in Ansible.
>
> Thanks
>
> Jordan
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d54017b1-5747-4145-833c-c8a451a55cab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_scheduled_task : run the scheduled task every minute

2018-02-15 Thread Jordan Borean
Not in any easy idempotent way unfortunately, you have some options, you 
could;

* Use win_command/win_shell to create the task but the COM API used can get 
quite complex and dealing with idempotency would be difficult
* You can copy the newer version of the module 
https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/windows/win_scheduled_task.ps1
 
to a directory called library and use it like you would when 2.5 is out. It 
is best to name the module with a special suffix so you know that it is a 
custom version and not the builtin module used in Ansible.

Thanks

Jordan

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7092b62c-463d-4eb5-8540-33957fd5f384%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_scheduled_task : run the scheduled task every minute

2018-02-15 Thread ktesr123456
Thanks Jordan,

We are still evaluating on moving to 2.5. Do we have any workaround in 2.0

Thanks.

On Thursday, February 15, 2018 at 1:13:27 AM UTC-5, Jordan Borean wrote:
>
> In the latest release it isn't possible to do with the current 
> win_scheduled_task module. For 2.5 the module was drastically rewritten and 
> supports this scenario, you can find the latest docs for it here 
> http://docs.ansible.com/ansible/devel/modules/win_scheduled_task_module.html
> .
>
> Using your example this is how it could possibly be done with the new 
> format in 2.5
>
> - name: create scheduled task to run every minute
>   win_scheduled_task:
> name: task name here
> actions:
> - path: cmd.exe
>   arguments: /c echo hello world
> triggers:
> - type: registration
>   repetition:
>   - interval: PT1M
> duration: '' # an empty value should mean it last infinitely
>
>
> What this means is that a task that run "cmd.exe /c echo hello world" will 
> create a registration trigger and run that every minute indefinitely. The 
> registration trigger just means start the task on registration.
>
> Thanks
>
> Jordan
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7e48d695-375a-45ea-b94e-20da26a657d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_scheduled_task : run the scheduled task every minute

2018-02-14 Thread Jordan Borean
In the latest release it isn't possible to do with the current 
win_scheduled_task module. For 2.5 the module was drastically rewritten and 
supports this scenario, you can find the latest docs for it here 
http://docs.ansible.com/ansible/devel/modules/win_scheduled_task_module.html.

Using your example this is how it could possibly be done with the new 
format in 2.5

- name: create scheduled task to run every minute
  win_scheduled_task:
name: task name here
actions:
- path: cmd.exe
  arguments: /c echo hello world
triggers:
- type: registration
  repetition:
  - interval: PT1M
duration: '' # an empty value should mean it last infinitely


What this means is that a task that run "cmd.exe /c echo hello world" will 
create a registration trigger and run that every minute indefinitely. The 
registration trigger just means start the task on registration.

Thanks

Jordan

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/321d1d6b-20bb-44ef-9c51-345d66defe10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.