using mail module with Windows roles

Hi all,

I am facing an issue where I have written playbook with roles to configure and install Windows machines, the problem is when I try to send a notification email inside a task of a role, then the mail module will fail as it tried to use Ansible connection (set to winrm).

I tried to delegate to local host and I tried also to use local_action option, but both failed :frowning:

I though of move all the tasks into a main Playbook but that will need to re-structure the whole thing.

Can anyone please suggest the best way do this ?

Thanks
Samer