diff --git a/tasks/main.yml b/tasks/main.yml
index 13b041abc2bccded81edc0a4dcd3710fa541bb13..54aa50d5f2b480f39e15705235e8c9e223883bdb 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -12,4 +12,4 @@
     - name: Import fluentd-client
       import_tasks: fluentd-client.yml
 
-  when: not excluded_roles or "fluentd-client" not in excluded_roles and fluentd_host is defined and fluentd_host != ""
+  when: (not excluded_roles or "fluentd-client" not in excluded_roles) and fluentd_host is defined and fluentd_host != ""