From 17f65a7a9e942dfeaeea160ecf6d579f29b01139 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Sun, 15 Apr 2018 14:37:56 +0200
Subject: [PATCH] Improve handling of proxy_active variable

---
 tasks/main.yml      | 4 ++--
 tasks/proxypool.yml | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tasks/main.yml b/tasks/main.yml
index 59f9dcb..8d30eb1 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -29,8 +29,8 @@
     import_tasks: 'buildcerts.yml'
 
   tags: 'Certs'
-  when: 'proxy_active is defined and proxy_active and "letsencrypt" not in excluded_roles'
+  when: 'proxy_active|default(true) and "letsencrypt" not in excluded_roles'
 
 - import_tasks: 'proxypool.yml'
-  when: 'proxy_active is defined and "letsencrypt" not in excluded_roles'
+  when: '"letsencrypt" not in excluded_roles'
   tags: 'Certs'
diff --git a/tasks/proxypool.yml b/tasks/proxypool.yml
index 0ba49fb..f1904b8 100644
--- a/tasks/proxypool.yml
+++ b/tasks/proxypool.yml
@@ -8,17 +8,17 @@
       path: '/etc/letsencrypt'
       owner: '{{ ansible_env.SUDO_USER }}'
       recurse: yes
-    when: proxy_active
+    when: proxy_active|default(true)
 
   - name: "Pull Certs from active Proxy"
     import_tasks: 'pullcerts.yml'
-    when: not proxy_active
+    when: not proxy_active|default(true)
 
   - name: "Set directory permissions to root"
     file:
       path: '/etc/letsencrypt'
       owner: 'root'
       recurse: yes
-    when: proxy_active
+    when: proxy_active|default(true)
 
   tags: 'Certs'
-- 
GitLab