# With the us of "meta: flush_handlers" we can execute the handlers in between of the task # The steps that are executed while executing the playbook is important # create a file -> (handlers) adding content -> changing ownership -> installing zsh # create a file -> installing zsh -> (handlers) adding content -> changing ownership. --- - name: Demonstration of executing the handler in between of regular task instaed of end of play hosts: nodes tasks: - name: Create a file file: path: /tmp/meta state: touch notify: created - name: Calling handlers meta: flush_handlers - name: Extra task adding of installing zsh package dnf: name: zsh state: latest handlers: - name: Adding content copy: content: In these play handler will be executed in between of the regular task dest: /tmp/meta listen: created - name: changing the ownership and group of created file meta command: "chown localadmin:localadmin /tmp/meta" listen: created ...