Ansible lint: remove comparison with true or false

Change-Id: I3caa4581ba276082e859f18aaa6638472f5fbe49
Co-Authored-By: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
This commit is contained in:
Mark Goddard 2020-01-13 10:32:36 +00:00
parent ac62b560ff
commit 9e3c774371
9 changed files with 14 additions and 14 deletions

View File

@ -5,7 +5,7 @@
name: "{{ item.name }}" name: "{{ item.name }}"
action: "get_container_state" action: "get_container_state"
register: container_state register: container_state
failed_when: container_state.Running == false failed_when: not container_state.Running
when: inventory_hostname in groups[item.group] when: inventory_hostname in groups[item.group]
with_items: with_items:
- { name: bifrost-deploy, group: bifrost-deploy } - { name: bifrost-deploy, group: bifrost-deploy }

View File

@ -5,7 +5,7 @@
name: "{{ item.name }}" name: "{{ item.name }}"
action: "get_container_state" action: "get_container_state"
register: ceph_mon_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] when: inventory_hostname in groups[item.group]
with_items: with_items:
- { name: ceph_mon, group: ceph-mon } - { name: ceph_mon, group: ceph-mon }
@ -39,7 +39,7 @@
name: "ceph_osd_{{ item.stdout }}" name: "ceph_osd_{{ item.stdout }}"
action: "get_container_state" action: "get_container_state"
register: ceph_osd_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'] when: inventory_hostname in groups['ceph-osd']
with_items: "{{ osd_ids.results|default({}) }}" with_items: "{{ osd_ids.results|default({}) }}"
@ -49,7 +49,7 @@
name: "{{ item.name }}" name: "{{ item.name }}"
action: "get_container_state" action: "get_container_state"
register: ceph_rgw_container_state register: ceph_rgw_container_state
failed_when: ceph_rgw_container_state.Running == false failed_when: not ceph_rgw_container_state.Running
when: when:
- enable_ceph_rgw | bool - enable_ceph_rgw | bool
- inventory_hostname in groups[item.group] - inventory_hostname in groups[item.group]

View File

@ -23,7 +23,7 @@
- include_tasks: external_ceph.yml - include_tasks: external_ceph.yml
when: 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-volume'] or
inventory_hostname in groups['cinder-backup'] inventory_hostname in groups['cinder-backup']

View File

@ -19,7 +19,7 @@
- include_tasks: external_ceph.yml - include_tasks: external_ceph.yml
when: when:
- enable_ceph | bool == False - not enable_ceph | bool
- gnocchi_backend_storage == 'ceph' - gnocchi_backend_storage == 'ceph'
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten

View File

@ -120,7 +120,7 @@
msg: "External haproxy certificate file is not found. It is configured via 'kolla_external_fqdn_cert'" msg: "External haproxy certificate file is not found. It is configured via 'kolla_external_fqdn_cert'"
when: when:
- kolla_enable_tls_external | bool - kolla_enable_tls_external | bool
- haproxy_cert_file.stat.exists == false - not haproxy_cert_file.stat.exists
- name: Checking if internal haproxy certificate exists - name: Checking if internal haproxy certificate exists
run_once: true run_once: true
@ -137,7 +137,7 @@
msg: "Internal haproxy certificate file is not found. It is configured via 'kolla_internal_fqdn_cert'" msg: "Internal haproxy certificate file is not found. It is configured via 'kolla_internal_fqdn_cert'"
when: when:
- kolla_enable_tls_internal | bool - 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 - 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'" 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'" fail: "msg='Please check the kolla_external_vip_interface settings - interface {{ kolla_external_vip_interface }} is not active'"
when: when:
- haproxy_enable_external_vip | bool - 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 - 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 }}" command: "{{ item.command }} -c 3 {{ item.address }}"

View File

@ -21,8 +21,8 @@
- include_tasks: external_ceph.yml - include_tasks: external_ceph.yml
when: when:
- enable_ceph| bool == False - not enable_ceph| bool
- enable_ceph_mds| bool == False - not enable_ceph_mds| bool
- (enable_manila_backend_cephfs_native | bool) or (enable_manila_backend_cephfs_nfs | bool) - (enable_manila_backend_cephfs_native | bool) or (enable_manila_backend_cephfs_nfs | bool)
- inventory_hostname in groups['manila-share'] - inventory_hostname in groups['manila-share']

View File

@ -5,7 +5,7 @@
- name: Checking the api_interface is active - name: Checking the api_interface is active
fail: "msg='Please check the api_interface settings - interface {{ api_interface }} is not 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 # kolla_address handles relevant address check
- name: Checking the api_interface ip address configuration - name: Checking the api_interface ip address configuration

View File

@ -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." 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 }}' with_items: '{{ swift_ring_files.results }}'
when: when:
- item.stat.exists == false - not item.stat.exists

View File

@ -35,7 +35,7 @@
name: "{{ item.name }}" name: "{{ item.name }}"
action: "get_container_state" action: "get_container_state"
register: container_state register: container_state
failed_when: container_state.Running == false failed_when: not container_state.Running
when: inventory_hostname in groups[item.group] when: inventory_hostname in groups[item.group]
with_items: with_items:
- "{{ swift_containers }}" - "{{ swift_containers }}"