diff --git a/tasks/main.yml b/tasks/main.yml
index fb9f1c9a7fe6b62f2348e0fdf684004bcebdb6ea..9ceb317d7c4149fd4a9ca456f921c2e686699d1e 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -17,7 +17,7 @@
       tags:
         - ApacheConfig
 
-  when: not excluded_roles or "letsencrypt" not in excluded_roles and groups.proxyserver is not defined
+  when: (not excluded_roles or "letsencrypt" not in excluded_roles) and groups.proxyserver is not defined
 
 - block:
     - name: Install matomo