ansible-lint: don't compare to empty string [E602] (#4665)

This commit is contained in:
MarkusTeufelberger
2019-04-29 08:00:20 +02:00
committed by Kubernetes Prow Robot
parent f518b90c6b
commit 88d919337e
17 changed files with 89 additions and 71 deletions

View File

@@ -2,57 +2,57 @@
- name: check azure_tenant_id value
fail:
msg: "azure_tenant_id is missing"
when: azure_tenant_id is not defined or azure_tenant_id == ""
when: azure_tenant_id is not defined or not azure_tenant_id
- name: check openstack_username value
fail:
msg: "azure_subscription_id is missing"
when: azure_subscription_id is not defined or azure_subscription_id == ""
when: azure_subscription_id is not defined or not azure_subscription_id
- name: check azure_aad_client_id value
fail:
msg: "azure_aad_client_id is missing"
when: azure_aad_client_id is not defined or azure_aad_client_id == ""
when: azure_aad_client_id is not defined or not azure_aad_client_id
- name: check azure_aad_client_secret value
fail:
msg: "azure_aad_client_secret is missing"
when: azure_aad_client_secret is not defined or azure_aad_client_secret == ""
when: azure_aad_client_secret is not defined or not azure_aad_client_secret
- name: check azure_resource_group value
fail:
msg: "azure_resource_group is missing"
when: azure_resource_group is not defined or azure_resource_group == ""
when: azure_resource_group is not defined or not azure_resource_group
- name: check azure_location value
fail:
msg: "azure_location is missing"
when: azure_location is not defined or azure_location == ""
when: azure_location is not defined or not azure_location
- name: check azure_subnet_name value
fail:
msg: "azure_subnet_name is missing"
when: azure_subnet_name is not defined or azure_subnet_name == ""
when: azure_subnet_name is not defined or not azure_subnet_name
- name: check azure_security_group_name value
fail:
msg: "azure_security_group_name is missing"
when: azure_security_group_name is not defined or azure_security_group_name == ""
when: azure_security_group_name is not defined or not azure_security_group_name
- name: check azure_vnet_name value
fail:
msg: "azure_vnet_name is missing"
when: azure_vnet_name is not defined or azure_vnet_name == ""
when: azure_vnet_name is not defined or not azure_vnet_name
- name: check azure_vnet_resource_group value
fail:
msg: "azure_vnet_resource_group is missing"
when: azure_vnet_resource_group is not defined or azure_vnet_resource_group == ""
when: azure_vnet_resource_group is not defined or not azure_vnet_resource_group
- name: check azure_route_table_name value
fail:
msg: "azure_route_table_name is missing"
when: azure_route_table_name is not defined or azure_route_table_name == ""
when: azure_route_table_name is not defined or not azure_route_table_name
- name: check azure_loadbalancer_sku value
fail:

View File

@@ -194,7 +194,7 @@
- cloud_provider is defined
- cloud_provider == 'openstack'
- openstack_cacert is defined
- openstack_cacert != ""
- openstack_cacert
tags:
- cloud-provider

View File

@@ -2,31 +2,33 @@
- name: check openstack_auth_url value
fail:
msg: "openstack_auth_url is missing"
when: openstack_auth_url is not defined or openstack_auth_url == ""
when: openstack_auth_url is not defined or not openstack_auth_url
- name: check openstack_username value
fail:
msg: "openstack_username is missing"
when: openstack_username is not defined or openstack_username == ""
when: openstack_username is not defined or not openstack_username
- name: check openstack_password value
fail:
msg: "openstack_password is missing"
when: openstack_password is not defined or openstack_password == ""
when: openstack_password is not defined or not openstack_password
- name: check openstack_region value
fail:
msg: "openstack_region is missing"
when: openstack_region is not defined or openstack_region == ""
when: openstack_region is not defined or not openstack_region
- name: check openstack_tenant_id value
fail:
msg: "one of openstack_tenant_id or openstack_trust_id must be specified"
when: (openstack_tenant_id is not defined or openstack_tenant_id == "") and
openstack_trust_id is not defined
when:
- openstack_tenant_id is not defined or not openstack_tenant_id
- openstack_trust_id is not defined
- name: check openstack_trust_id value
fail:
msg: "one of openstack_tenant_id or openstack_trust_id must be specified"
when: (openstack_trust_id is not defined or openstack_trust_id == "") and
openstack_tenant_id is not defined
when:
- openstack_trust_id is not defined or not openstack_trust_id
- openstack_tenant_id is not defined

View File

@@ -2,7 +2,7 @@
- name: check vsphere environment variables
fail:
msg: "{{ item.name }} is missing"
when: item.value is not defined or item.value == ''
when: item.value is not defined or not item.value
with_items:
- name: vsphere_vcenter_ip
value: "{{ vsphere_vcenter_ip }}"