# FILENAME: group_handlers.yml --- - name: Grouping the handlers in other word restricting handler to wait till notifying captures the changed state hosts: nodes tasks: - name: Allowing cron execution to all command: "echo >> /etc/cron.allow" notify: backup file handlers: - name: Creating the file file: path: /tmp/grouping state: touch listen: backup file - name: add a line to cron file lineinfile: line: $(date) insertafter: EOF path: /tmp/grouping listen: backup file - name: removing all the things done in the above 2 handlers task file: path: /tmp/grouping state: absent listen: backup file ...