diff --git a/tasks/main.yml b/tasks/main.yml
index 069871b4a73c6c4d61e92de46caff22c1f91f728..62216f7a37e4156eb78f1125c15ef5747019b7a2 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -15,7 +15,7 @@
         loop_var: domain
       when: domain.protocol|default("https") == "https" and domain.letsencrypt|default(true)
 
-  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: Ensure Download Directory