ansible-lint: Don’t compare to literal True/False (#4499)

This commit is contained in:
Maxime Guyot 2019-04-17 17:42:03 +02:00 committed by Kubernetes Prow Robot
parent d4b9f15c0a
commit 37eac010c8
11 changed files with 22 additions and 17 deletions

View file

@ -19,6 +19,5 @@ skip_list:
- '502' - '502'
- '503' - '503'
- '504' - '504'
- '601'
- '602' - '602'
- '701' - '701'

View file

@ -528,7 +528,7 @@ downloads:
- kube-node - kube-node
nodelocaldns: nodelocaldns:
enabled: "{{ enable_nodelocaldns == True }}" enabled: "{{ enable_nodelocaldns }}"
container: true container: true
repo: "{{ nodelocaldns_image_repo }}" repo: "{{ nodelocaldns_image_repo }}"
tag: "{{ nodelocaldns_image_tag }}" tag: "{{ nodelocaldns_image_tag }}"

View file

@ -31,7 +31,7 @@
- name: Kubernetes Apps | nodelocalDNS - name: Kubernetes Apps | nodelocalDNS
import_tasks: "tasks/nodelocaldns.yml" import_tasks: "tasks/nodelocaldns.yml"
when: when:
- enable_nodelocaldns == True - enable_nodelocaldns
- inventory_hostname == groups['kube-master'] | first - inventory_hostname == groups['kube-master'] | first
tags: tags:
- nodelocaldns - nodelocaldns

View file

@ -32,7 +32,7 @@
/etc/resolv.conf /etc/resolv.conf
{%- endif -%} {%- endif -%}
when: when:
- enable_nodelocaldns == True - enable_nodelocaldns
- inventory_hostname == groups['kube-master'] | first - inventory_hostname == groups['kube-master'] | first
tags: tags:
- nodelocaldns - nodelocaldns

View file

@ -3,31 +3,31 @@
- name: "OCI Cloud Controller | Credentials Check | oci_private_key" - name: "OCI Cloud Controller | Credentials Check | oci_private_key"
fail: fail:
msg: "oci_private_key is missing" msg: "oci_private_key is missing"
when: (oci_use_instance_principals == false) and when: (not oci_use_instance_principals) and
(oci_private_key is not defined or oci_private_key == "") (oci_private_key is not defined or oci_private_key == "")
- name: "OCI Cloud Controller | Credentials Check | oci_region_id" - name: "OCI Cloud Controller | Credentials Check | oci_region_id"
fail: fail:
msg: "oci_region_id is missing" msg: "oci_region_id is missing"
when: (oci_use_instance_principals == false) and when: (not oci_use_instance_principals) and
(oci_region_id is not defined or oci_region_id == "") (oci_region_id is not defined or oci_region_id == "")
- name: "OCI Cloud Controller | Credentials Check | oci_tenancy_id" - name: "OCI Cloud Controller | Credentials Check | oci_tenancy_id"
fail: fail:
msg: "oci_tenancy_id is missing" msg: "oci_tenancy_id is missing"
when: (oci_use_instance_principals == false) and when: (not oci_use_instance_principals) and
(oci_tenancy_id is not defined or oci_tenancy_id == "") (oci_tenancy_id is not defined or oci_tenancy_id == "")
- name: "OCI Cloud Controller | Credentials Check | oci_user_id" - name: "OCI Cloud Controller | Credentials Check | oci_user_id"
fail: fail:
msg: "oci_user_id is missing" msg: "oci_user_id is missing"
when: (oci_use_instance_principals == false) and when: (not oci_use_instance_principals) and
(oci_user_id is not defined or oci_user_id == "") (oci_user_id is not defined or oci_user_id == "")
- name: "OCI Cloud Controller | Credentials Check | oci_user_fingerprint" - name: "OCI Cloud Controller | Credentials Check | oci_user_fingerprint"
fail: fail:
msg: "oci_user_fingerprint is missing" msg: "oci_user_fingerprint is missing"
when: (oci_use_instance_principals == false) and when: (not oci_use_instance_principals) and
(oci_user_fingerprint is not defined or oci_user_fingerprint == "") (oci_user_fingerprint is not defined or oci_user_fingerprint == "")
- name: "OCI Cloud Controller | Credentials Check | oci_compartment_id" - name: "OCI Cloud Controller | Credentials Check | oci_compartment_id"

View file

@ -11,7 +11,7 @@
when: inventory_hostname == groups['kube-master'][0] and not item is skipped when: inventory_hostname == groups['kube-master'][0] and not item is skipped
- name: Cilium | Wait for pods to run - name: Cilium | Wait for pods to run
command: "{{bin_dir}}/kubectl -n kube-system get pods -l k8s-app=cilium -o jsonpath='{.items[?(@.status.containerStatuses[0].ready==false)].metadata.name}'" command: "{{bin_dir}}/kubectl -n kube-system get pods -l k8s-app=cilium -o jsonpath='{.items[?(@.status.containerStatuses[0].ready==false)].metadata.name}'" # noqa 601
register: pods_not_ready register: pods_not_ready
until: pods_not_ready.stdout.find("cilium")==-1 until: pods_not_ready.stdout.find("cilium")==-1
retries: 30 retries: 30

View file

@ -12,7 +12,7 @@
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- name: kube-router | Wait for kube-router pods to be ready - name: kube-router | Wait for kube-router pods to be ready
command: "{{bin_dir}}/kubectl -n kube-system get pods -l k8s-app=kube-router -o jsonpath='{.items[?(@.status.containerStatuses[0].ready==false)].metadata.name}'" command: "{{bin_dir}}/kubectl -n kube-system get pods -l k8s-app=kube-router -o jsonpath='{.items[?(@.status.containerStatuses[0].ready==false)].metadata.name}'" # noqa 601
register: pods_not_ready register: pods_not_ready
until: pods_not_ready.stdout.find("kube-router")==-1 until: pods_not_ready.stdout.find("kube-router")==-1
retries: 30 retries: 30

View file

@ -18,12 +18,18 @@
- kubelet - kubelet
- import_tasks: nginx-proxy.yml - import_tasks: nginx-proxy.yml
when: is_kube_master == false and loadbalancer_apiserver_localhost and loadbalancer_apiserver_type == 'nginx' when:
- not is_kube_master
- loadbalancer_apiserver_localhost
- loadbalancer_apiserver_type == 'nginx'
tags: tags:
- nginx - nginx
- import_tasks: haproxy.yml - import_tasks: haproxy.yml
when: is_kube_master == false and loadbalancer_apiserver_localhost and loadbalancer_apiserver_type == 'haproxy' when:
- not is_kube_master
- loadbalancer_apiserver_localhost
- loadbalancer_apiserver_type == 'haproxy'
tags: tags:
- haproxy - haproxy

View file

@ -77,7 +77,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
{% else %} {% else %}
{% set kubelet_args_cluster_dns %}{% endset %} {% set kubelet_args_cluster_dns %}{% endset %}
{% endif %} {% endif %}
{% if enable_nodelocaldns == True %} {% if enable_nodelocaldns %}
{% set kubelet_args_cluster_dns %}--cluster-dns={{ nodelocaldns_ip }}{% endset %} {% set kubelet_args_cluster_dns %}--cluster-dns={{ nodelocaldns_ip }}{% endset %}
{% endif %} {% endif %}
{% set kubelet_args_dns %}{{ kubelet_args_cluster_dns }} --cluster-domain={{ dns_domain }} --resolv-conf={{ kube_resolv_conf }}{% endset %} {% set kubelet_args_dns %}{{ kubelet_args_cluster_dns }} --cluster-domain={{ dns_domain }} --resolv-conf={{ kube_resolv_conf }}{% endset %}

View file

@ -12,7 +12,7 @@
state: "{{ preinstall_selinux_state }}" state: "{{ preinstall_selinux_state }}"
when: when:
- ansible_os_family == "RedHat" - ansible_os_family == "RedHat"
- slc.stat.exists == True - slc.stat.exists
changed_when: False changed_when: False
tags: tags:
- bootstrap-os - bootstrap-os

View file

@ -18,7 +18,7 @@
with_dict: with_dict:
- "{{ images }}" - "{{ images }}"
when: when:
- item.value.converted|bool != true - not (item.value.converted|bool)
register: converted register: converted
- name: Make sure all images are ending with qcow2 - name: Make sure all images are ending with qcow2
@ -26,7 +26,7 @@
with_dict: with_dict:
- "{{ images }}" - "{{ images }}"
when: when:
- item.value.converted|bool == true - item.value.converted|bool
- name: Resize images - name: Resize images
command: qemu-img resize {{ images_dir }}/{{ item.key }}.qcow2 +8G command: qemu-img resize {{ images_dir }}/{{ item.key }}.qcow2 +8G