cross-posted from: https://lemmy.ml/post/4593804
Originally discussed on Matrix.
TLDR; Ansible handlers are added to the global namespace.
Suppose you’ve got a role which defines a handler
MyHandler:- name: MyHandler ... listen: "some-topic"Each time you
import/includeyour role, a new reference toMyHandleris added to the global namespace.As a result, when you
notifyyour handler via the topics itlistens to (ienotify: "some-topic"), all the references toMyHandlerwill be executed by Ansible.If that’s not what you want, you should
notifythe handler by name (ienotify: MyHandler) in which case Ansible will stop searching for other references as soon as it finds the first occurrence ofMyHandler. That meansMyHandlerwill be executed only once.
You must log in or register to comment.

