[WARNING]: flush_handlers task does not support when conditional

I have really simple role, in which I have these tasks:

`

This appears to be fine, but as you say this is only the role.
This indicates that issue is elsewhere, for instance in the calling playbook.
Can you share that?

my main.yml is really simply like this:

`

When using import_tasks, ansible will read the file, and effectively replace your import_tasks with the tasks that are inside it. When we do that, the when statement gets added to each individual task within.

As such, you get this warning.

Switching to include_tasks should avoid this.