I tried the following modified playbook:

*- hosts: Windows*
*  gather_facts: false*
*  tasks:*
*    - name: Ensure Service status is running and startup mode set to
Automatic*
*      win_service:*
*        name: MSSQLSERVER*
*        state: started*
*        start_mode: auto*


*    - name: Send Job completion notification to MS Teams*
*      script: /tmp/ansible_scripts/MSTeamsNotifications.pyc*
*      args:*
*        executable: /usr/bin/python*
*      delegate_to: 127.0.0.1*
*...*

but getting the following error:
TASK [Send Job completion notification to MS Teams]
****************************
19:57:29
9
fatal: [WinTest4143 -> 127.0.0.1]: FAILED! => {"changed": false, "msg":
"Could not find or access '/tmp/ansible_scripts/MSTeamsNotifications.pyc'
on the Ansible Controller.\nIf you are using a module and expect the file
to exist on the remote, see the remote_src option"}

this file exists on Ansible Server and works fine. The file has full
permissions too but it doesn't work.

*$ ls -lrt /tmp/ansible_scripts/MSTeamsNotifications.pyc*
*-rwxrwxrwx. 1 anks users 1043 Dec 15 07:21
/tmp/ansible_scripts/MSTeamsNotifications.pyc*


*$ /usr/bin/python /tmp/ansible_scripts/MSTeamsNotifications.pyc*
*MSTeamsNotifications.py - Send Notifications to MS Teams Team*
*1*

*Thanks and Regards,*
*Ankit*

On Sat, Dec 15, 2018 at 6:49 PM Kai Stian Olstad <
[email protected]> wrote:

> On Saturday, 15 December 2018 13:37:17 CET Ankit Vashistha wrote:
> > I have one more query though. What is the exact different between
> > local_action* and delegate_to ?*
>
> Nothing.
>
> I prefer using delegate_to since it's then easy to add or remove the
> delegation.
> If using local_action more change need to be done to add or remove it.
>
>
>
> --
> 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/2106464.YxtZNk02ic%40x1.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CACecUhsLrDVEVi5bQ_6CuAk1V05qTDP07ofgVsWbNccM%3Db%3DLPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to