how to execute a handler if a file is found

Hello

I would like to be able to find the files that are bigger than a certain dize and then restart a service if this happens because it mean the rotation is not working after the configurtion update

the find module does not ‘change’ when the file is found or not and i know i can trigger a change using
when_changed: true

per instance:

`

Maybe something like this:

  • name: find files
    find:
    path: /var/log
    patterns: ‘*.log’
    size: 100m
    register: bigfiles
    changed_when: bigfiles.files !=
    notify: start service

Ansible would also be a great tool to prevent breakage like "rotation
is not working after configuration update" from occurring in the first
place.
You might want to fix that, at some point.