From c51669531ba9106a33cb363d11eb2a022660c0f0 Mon Sep 17 00:00:00 2001 From: Mathieu Trossevin Date: Fri, 19 Jun 2020 14:14:23 +0200 Subject: [PATCH] [Cleanup] squid: Compare with empty string + name tasks --- squid/tasks/main.yml | 9 +++++---- squid/tasks/systemd.yml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/squid/tasks/main.yml b/squid/tasks/main.yml index 68f721f8..22c23bc1 100644 --- a/squid/tasks/main.yml +++ b/squid/tasks/main.yml @@ -1,6 +1,7 @@ --- -- fail: +- name: Check for role compatibility + fail: msg: only compatible with Debian >= 8 when: - ansible_distribution != "Debian" or ansible_distribution_major_version is version('8', '<') @@ -79,7 +80,7 @@ content: | # Put customized values here. force: no - when: squid_localproxy_enable == False and ansible_distribution_major_version is version('9', '>=') + when: not squid_localproxy_enable and ansible_distribution_major_version is version('9', '>=') - name: "evolinux http_access for local proxy (Debian 9 or later)" copy: @@ -95,7 +96,7 @@ content: | # Put customized values here. force: no - when: squid_localproxy_enable == False and ansible_distribution_major_version is version('9', '>=') + when: not squid_localproxy_enable and ansible_distribution_major_version is version('9', '>=') - name: "evolinux overrides for local proxy (Debian 9 or later)" template: @@ -111,7 +112,7 @@ content: | # Put customized values here. force: no - when: squid_localproxy_enable == False and ansible_distribution_major_version is version('9', '>=') + when: not squid_localproxy_enable and ansible_distribution_major_version is version('9', '>=') - name: add some URL in whitelist (Debian 8) lineinfile: diff --git a/squid/tasks/systemd.yml b/squid/tasks/systemd.yml index 4d06fa5d..39f72bc9 100644 --- a/squid/tasks/systemd.yml +++ b/squid/tasks/systemd.yml @@ -6,7 +6,7 @@ failed_when: False check_mode: no register: _squid_systemd_active - + - name: Squid systemd overrides directory exists file: dest: /etc/systemd/system/squid.service.d/