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
This commit is contained in:
Jacky Hu 2017-04-07 16:24:31 +08:00
parent f7ca083c02
commit 3a1418afd0

View File

@ -28,9 +28,9 @@
dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy" dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy"
register: apt_proxy_dropped register: apt_proxy_dropped
when: when:
- repo_pkg_cache_enabled | bool
- proxy_check.status == 200 - proxy_check.status == 200
- ansible_os_family == 'Debian' - ansible_os_family == 'Debian'
- repo_pkg_cache_enabled | bool
tags: tags:
- common-proxy - common-proxy
@ -49,9 +49,9 @@
dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy" dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy"
state: "absent" state: "absent"
when: when:
- repo_pkg_cache_enabled | bool
- proxy_check.status != 200 - proxy_check.status != 200
- ansible_os_family == 'Debian' - ansible_os_family == 'Debian'
- repo_pkg_cache_enabled | bool
tags: tags:
- common-proxy - common-proxy