From 87e90a08935cacf74adc63bece3d902c17cd9bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 1 Nov 2018 14:02:55 +0100 Subject: [PATCH] lint: Don't compare to literal True/False MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use `when: var` rather than `when: var == True` Signed-off-by: Sébastien Han --- roles/ceph-docker-common/tasks/checks.yml | 2 +- roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml | 4 ++-- roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml | 2 +- roles/ceph-mds/tasks/containerized.yml | 2 +- roles/ceph-nfs/tasks/pre_requisite_container.yml | 2 +- site.yml.sample | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/roles/ceph-docker-common/tasks/checks.yml b/roles/ceph-docker-common/tasks/checks.yml index b892cc642..8bfa16a8b 100644 --- a/roles/ceph-docker-common/tasks/checks.yml +++ b/roles/ceph-docker-common/tasks/checks.yml @@ -10,5 +10,5 @@ - "{{ statconfig.results }}" when: - inventory_hostname == groups.get(mon_group_name) - - item.1.stat.exists == true + - item.1.stat.exists - ceph_health.stdout_lines | length == 0 diff --git a/roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml b/roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml index afd474db5..ae3456818 100644 --- a/roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml +++ b/roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml @@ -26,7 +26,7 @@ run_once: True with_items: "{{ crt_files_exist.results }}" when: - - item.stat.exists == false + - not item.stat.exists - name: create pem shell: > @@ -37,7 +37,7 @@ register: pem with_items: "{{ crt_files_exist.results }}" when: - - item.stat.exists == false + - not item.stat.exists - name: create public key from pem shell: > diff --git a/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml b/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml index 4ccbe70cf..0e1d60dfb 100644 --- a/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml +++ b/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml @@ -58,7 +58,7 @@ enabled: no when: - target.stat.exists - - target.stat.islnk == False + - not target.stat.islnk - name: enable the rbd-target-gw service and make sure it is running service: diff --git a/roles/ceph-mds/tasks/containerized.yml b/roles/ceph-mds/tasks/containerized.yml index 9fc286581..f99001368 100644 --- a/roles/ceph-mds/tasks/containerized.yml +++ b/roles/ceph-mds/tasks/containerized.yml @@ -43,7 +43,7 @@ with_together: - "{{ ceph_config_keys }}" - "{{ statconfig.results }}" - when: item.1.stat.exists == true + when: item.1.stat.exists - name: generate systemd unit file become: true diff --git a/roles/ceph-nfs/tasks/pre_requisite_container.yml b/roles/ceph-nfs/tasks/pre_requisite_container.yml index 3fffdd387..1f2e02a96 100644 --- a/roles/ceph-nfs/tasks/pre_requisite_container.yml +++ b/roles/ceph-nfs/tasks/pre_requisite_container.yml @@ -40,7 +40,7 @@ - "{{ ceph_config_keys }}" - "{{ statconfig.results }}" when: - - item.1.stat.exists == true + - item.1.stat.exists - name: create dbus service file become: true diff --git a/site.yml.sample b/site.yml.sample index db93692e6..c6822f9e7 100644 --- a/site.yml.sample +++ b/site.yml.sample @@ -38,19 +38,19 @@ raw: sudo apt-get -y install python-simplejson ignore_errors: yes when: - - systempython2.stat is undefined or systempython2.stat.exists == false + - systempython2.stat is undefined or not systempython2.stat.exists - name: install python2 for fedora raw: sudo dnf -y install python creates=/usr/bin/python ignore_errors: yes when: - - systempython2.stat is undefined or systempython2.stat.exists == false + - systempython2.stat is undefined or not systempython2.stat.exists - name: install python2 for opensuse raw: sudo zypper -n install python-base creates=/usr/bin/python2.7 ignore_errors: yes when: - - systempython2.stat is undefined or systempython2.stat.exists == false + - systempython2.stat is undefined or not systempython2.stat.exists - name: gather facts setup: