Clean some Boolean condition checks

* "bool" filter is removed when not required
* 'not' is used instead of '== False' check

Change-Id: I85a5bb9a5ea874ac1c397cbf8de416147d2424c3
This commit is contained in:
Bertrand Lallau 2017-07-04 17:12:10 +02:00 committed by Bertrand Lallau
parent 4510c525a6
commit 8b5b3cef4e
9 changed files with 10 additions and 10 deletions

View File

@ -60,7 +60,7 @@
package: name={{item}} state=absent
with_items: "{{ ubuntu_pkg_removals }}"
become: True
when: ansible_distribution|lower == "ubuntu" | bool
when: ansible_distribution|lower == "ubuntu"
- name: Remove packages
package: name={{item}} state=absent

View File

@ -27,7 +27,7 @@
become: True
when:
- ansible_distribution == "Ubuntu"
- apparmor_libvirtd_profile.stat.exists | bool
- apparmor_libvirtd_profile.stat.exists
- name: Create docker group
group:

View File

@ -141,4 +141,4 @@
recurse: yes
mode: 0644
become: True
when: create_kolla_user | bool == False
when: not create_kolla_user | bool

View File

@ -34,7 +34,7 @@
ceph_osd_wipe_disk: 'yes-i-really-really-mean-it' within globals.yml)
with_items: "{{ osds_bootstrap|default([]) }}"
when:
- item.external_journal | bool == False
- not item.external_journal | bool
- item.device.split('/')[2] in ansible_devices # if there is no device in setup (like loopback, we don't need to warn user
- ansible_devices[item.device.split('/')[2]].partitions|count > 1
- ceph_osd_wipe_disk != "yes-i-really-really-mean-it"
@ -81,7 +81,7 @@
ceph_osd_wipe_disk: 'yes-i-really-really-mean-it' within globals.yml)
with_items: "{{ osds_cache_bootstrap|default([]) }}"
when:
- item.external_journal | bool == False
- not item.external_journal | bool
- ansible_devices[item.device.split('/')[2]].partitions|count > 1
- ceph_osd_wipe_disk != "yes-i-really-really-mean-it"

View File

@ -47,7 +47,7 @@
enabled: true
- name: "01-es"
enabled: "{{ enable_elasticsearch | bool or
( elasticsearch_address != kolla_internal_vip_address ) | bool }}"
( elasticsearch_address != kolla_internal_vip_address ) }}"
notify:
- Restart fluentd container

View File

@ -138,7 +138,7 @@
when:
- inventory_hostname in groups[keystone.group]
- keystone.enabled | bool
- check_keystone_paste_ini.stat.exists | bool
- check_keystone_paste_ini.stat.exists
notify:
- Restart keystone container

View File

@ -138,7 +138,7 @@
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- nova_policy.stat.exists | bool
- nova_policy.stat.exists
- item.key in services_require_policy_json
with_dict: "{{ nova_services }}"
notify:

View File

@ -12,7 +12,7 @@
- include: external-ceph.yml
when:
- enable_ceph | bool == False and nova_backend == "rbd"
- not enable_ceph | bool and nova_backend == "rbd"
- inventory_hostname in groups['compute']
- include: register.yml

View File

@ -182,7 +182,7 @@ kolla_internal_vip_address: "10.10.10.254"
#enable_neutron_vpnaas: "no"
#enable_nova_serialconsole_proxy: "no"
#enable_octavia: "no"
#enable_openvswitch: "{{ neutron_plugin_agent != 'linuxbridge' | bool }}"
#enable_openvswitch: "{{ neutron_plugin_agent != 'linuxbridge' }}"
#enable_osprofiler: "no"
#enable_panko: "no"
#enable_rally: "no"