diff --git a/tasks/main.yml b/tasks/main.yml
index e3d293dbea0488a01a268b3157156576849f42ac..a610dc8e33ac1c760b49d2663bd563d0d23797b0 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -37,4 +37,4 @@
       tags:
         - always
 
-  when: not excluded_roles or "php" not in excluded_roles and role_php_completed is not defined
+  when: (not excluded_roles or "php" not in excluded_roles) and role_php_completed is not defined