Hello Love,
It will be a great help if you can share the screenshot of your playbook’s output as well as the screenshot of source and destination.
The above playbook is working perfectly fine in our environment.
Thanks
Soniya
You cannot implement this scenario using Notify-Handler. You will have to use the WHEN condition (Implementation shown in below playbook).
One of the property of Handlers is that they get fired only if there is a
change in state of the task which is triggering the notification (Notify
Statement).
In your use-case there are 2 scenarios:
Scenario-1: The destination maven repo does not exist and is created by the File module. In this case there is a change in state of task which triggers the Notification to "maven repo created" handler. Hence the handler will execute and the files would get copied.
Scenario-2: The destination maven repo already exists and File module does nothing that results in the change of state of the task. Hence when the notification reaches the Handler it does nothing and files are not copied.
Since this is a valid effect produced by the Handler hence there were no error/alerts thrown during the playbook execution.
Correct playbook:
---
Thanks
Soniya