From 3a1418afd0398eba6e2788bd0d87aedfbe144bb6 Mon Sep 17 00:00:00 2001 From: Jacky Hu Date: Fri, 7 Apr 2017 16:24:31 +0800 Subject: [PATCH] Ensure proxy check is short circuit Otherwise when repo_pkg_cache_enabled is false and repo_pkg_cache_url is https, proxy_check.status will cause an attribute error. Change-Id: Ib0f5326865d11ecbb718e586441c4f7c2a754c9d --- playbooks/common-tasks/package-cache-proxy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/common-tasks/package-cache-proxy.yml b/playbooks/common-tasks/package-cache-proxy.yml index b943624d5a..8cbb06bed5 100644 --- a/playbooks/common-tasks/package-cache-proxy.yml +++ b/playbooks/common-tasks/package-cache-proxy.yml @@ -28,9 +28,9 @@ dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy" register: apt_proxy_dropped when: + - repo_pkg_cache_enabled | bool - proxy_check.status == 200 - ansible_os_family == 'Debian' - - repo_pkg_cache_enabled | bool tags: - common-proxy @@ -49,9 +49,9 @@ dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy" state: "absent" when: + - repo_pkg_cache_enabled | bool - proxy_check.status != 200 - ansible_os_family == 'Debian' - - repo_pkg_cache_enabled | bool tags: - common-proxy