From 9e3c7743718bdf096e31121a372c26eb3e055a84 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 13 Jan 2020 10:32:36 +0000 Subject: [PATCH] Ansible lint: remove comparison with true or false Change-Id: I3caa4581ba276082e859f18aaa6638472f5fbe49 Co-Authored-By: Marcin Juszkiewicz --- ansible/roles/bifrost/tasks/reconfigure.yml | 2 +- ansible/roles/ceph/tasks/reconfigure.yml | 6 +++--- ansible/roles/cinder/tasks/config.yml | 2 +- ansible/roles/gnocchi/tasks/config.yml | 2 +- ansible/roles/haproxy/tasks/precheck.yml | 6 +++--- ansible/roles/manila/tasks/config.yml | 4 ++-- ansible/roles/prechecks/tasks/port_checks.yml | 2 +- ansible/roles/swift/tasks/precheck.yml | 2 +- ansible/roles/swift/tasks/reconfigure.yml | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ansible/roles/bifrost/tasks/reconfigure.yml b/ansible/roles/bifrost/tasks/reconfigure.yml index 3364a5f014..ac3e5ca126 100644 --- a/ansible/roles/bifrost/tasks/reconfigure.yml +++ b/ansible/roles/bifrost/tasks/reconfigure.yml @@ -5,7 +5,7 @@ name: "{{ item.name }}" action: "get_container_state" register: container_state - failed_when: container_state.Running == false + failed_when: not container_state.Running when: inventory_hostname in groups[item.group] with_items: - { name: bifrost-deploy, group: bifrost-deploy } diff --git a/ansible/roles/ceph/tasks/reconfigure.yml b/ansible/roles/ceph/tasks/reconfigure.yml index 7b1f49d0fc..3b56f0f731 100644 --- a/ansible/roles/ceph/tasks/reconfigure.yml +++ b/ansible/roles/ceph/tasks/reconfigure.yml @@ -5,7 +5,7 @@ name: "{{ item.name }}" action: "get_container_state" register: ceph_mon_container_state - failed_when: ceph_mon_container_state.Running == false + failed_when: not ceph_mon_container_state.Running when: inventory_hostname in groups[item.group] with_items: - { name: ceph_mon, group: ceph-mon } @@ -39,7 +39,7 @@ name: "ceph_osd_{{ item.stdout }}" action: "get_container_state" register: ceph_osd_container_state - failed_when: ceph_osd_container_state.Running == false + failed_when: not ceph_osd_container_state.Running when: inventory_hostname in groups['ceph-osd'] with_items: "{{ osd_ids.results|default({}) }}" @@ -49,7 +49,7 @@ name: "{{ item.name }}" action: "get_container_state" register: ceph_rgw_container_state - failed_when: ceph_rgw_container_state.Running == false + failed_when: not ceph_rgw_container_state.Running when: - enable_ceph_rgw | bool - inventory_hostname in groups[item.group] diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml index e64bb210e2..ec052f5152 100644 --- a/ansible/roles/cinder/tasks/config.yml +++ b/ansible/roles/cinder/tasks/config.yml @@ -23,7 +23,7 @@ - include_tasks: external_ceph.yml when: - - (enable_ceph | bool == False) and (cinder_backend_ceph | bool) + - (not enable_ceph | bool) and (cinder_backend_ceph | bool) - inventory_hostname in groups['cinder-volume'] or inventory_hostname in groups['cinder-backup'] diff --git a/ansible/roles/gnocchi/tasks/config.yml b/ansible/roles/gnocchi/tasks/config.yml index 0f6bdacb63..85a9847fb8 100644 --- a/ansible/roles/gnocchi/tasks/config.yml +++ b/ansible/roles/gnocchi/tasks/config.yml @@ -19,7 +19,7 @@ - include_tasks: external_ceph.yml when: - - enable_ceph | bool == False + - not enable_ceph | bool - gnocchi_backend_storage == 'ceph' - name: Check if policies shall be overwritten diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 18a88d6260..c62362adb7 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -120,7 +120,7 @@ msg: "External haproxy certificate file is not found. It is configured via 'kolla_external_fqdn_cert'" when: - kolla_enable_tls_external | bool - - haproxy_cert_file.stat.exists == false + - not haproxy_cert_file.stat.exists - name: Checking if internal haproxy certificate exists run_once: true @@ -137,7 +137,7 @@ msg: "Internal haproxy certificate file is not found. It is configured via 'kolla_internal_fqdn_cert'" when: - kolla_enable_tls_internal | bool - - haproxy_internal_cert_file.stat.exists == false + - not haproxy_internal_cert_file.stat.exists - name: Checking the kolla_external_vip_interface is present fail: "msg='Please check the kolla_external_vip_interface property - interface {{ kolla_external_vip_interface }} not found'" @@ -149,7 +149,7 @@ fail: "msg='Please check the kolla_external_vip_interface settings - interface {{ kolla_external_vip_interface }} is not active'" when: - haproxy_enable_external_vip | bool - - hostvars[inventory_hostname]['ansible_' + kolla_external_vip_interface]['active'] != True + - not hostvars[inventory_hostname]['ansible_' + kolla_external_vip_interface]['active'] - name: Checking if kolla_internal_vip_address and kolla_external_vip_address are not pingable from any node command: "{{ item.command }} -c 3 {{ item.address }}" diff --git a/ansible/roles/manila/tasks/config.yml b/ansible/roles/manila/tasks/config.yml index 5c180e96b9..0137548507 100644 --- a/ansible/roles/manila/tasks/config.yml +++ b/ansible/roles/manila/tasks/config.yml @@ -21,8 +21,8 @@ - include_tasks: external_ceph.yml when: - - enable_ceph| bool == False - - enable_ceph_mds| bool == False + - not enable_ceph| bool + - not enable_ceph_mds| bool - (enable_manila_backend_cephfs_native | bool) or (enable_manila_backend_cephfs_nfs | bool) - inventory_hostname in groups['manila-share'] diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index 8b6fc81926..837b83d5e0 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -5,7 +5,7 @@ - name: Checking the api_interface is active fail: "msg='Please check the api_interface settings - interface {{ api_interface }} is not active'" - when: hostvars[inventory_hostname]['ansible_' + api_interface]['active'] != True + when: not hostvars[inventory_hostname]['ansible_' + api_interface]['active'] # kolla_address handles relevant address check - name: Checking the api_interface ip address configuration diff --git a/ansible/roles/swift/tasks/precheck.yml b/ansible/roles/swift/tasks/precheck.yml index ba0406a183..0b95a82610 100644 --- a/ansible/roles/swift/tasks/precheck.yml +++ b/ansible/roles/swift/tasks/precheck.yml @@ -118,4 +118,4 @@ msg: "Swift ring files do not exist. Ensure .builder and .gz are available for each of account/container/object under {{ node_custom_config }}/swift before deploying Swift." with_items: '{{ swift_ring_files.results }}' when: - - item.stat.exists == false + - not item.stat.exists diff --git a/ansible/roles/swift/tasks/reconfigure.yml b/ansible/roles/swift/tasks/reconfigure.yml index 6dcbb16377..9d7cf60a86 100644 --- a/ansible/roles/swift/tasks/reconfigure.yml +++ b/ansible/roles/swift/tasks/reconfigure.yml @@ -35,7 +35,7 @@ name: "{{ item.name }}" action: "get_container_state" register: container_state - failed_when: container_state.Running == false + failed_when: not container_state.Running when: inventory_hostname in groups[item.group] with_items: - "{{ swift_containers }}"