On Saturday, 15 December 2018 13:18:49 CET Ankit Vashistha wrote:
> I have got the following playbook:
> 
> ---
> - hosts: Windows
> 
>   tasks:
>     - name: Ensure Service status is running and startup mode set to 
> Automatic
>       win_service:
>         name: MSSQLSERVER
>         state: started
>         start_mode: auto
> ...
> 
> I want to run a Python script on the *localhost* i.e., the machine which 
> runs Ansible which sends Notification alert to MS Team chat window. How can 
> i modify the above playbook in such a way that once the task is completed, 
> the python script present in */home/myscript/msnotification.py *in 
> *localhost* is executed.

Add  delegate_to: localhost  on the task(s) you need to run on localhost and 
not the remote host.

-- 
Kai Stian Olstad


-- 
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/2744585.4kni9uFpsz%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to