From 39acb2b84d5a4d39c108020d1047ed7048d91d80 Mon Sep 17 00:00:00 2001 From: Takuya Murakami Date: Mon, 7 Mar 2022 22:35:55 +0900 Subject: [PATCH] Update ansible-lint to 5.4.0 (#8607) (#8608) * Update ansible-lint to 5.4.0 (#8607) It seems that the Rich version 11.0.0 has a breaking change. So need to update ansible-lint to 5.3.2 or later. * Fix for ansible-lint no-changed-when rule (#8607) --- roles/kubernetes/kubeadm/tasks/main.yml | 2 ++ roles/reset/tasks/main.yml | 1 + roles/upgrade/pre-upgrade/tasks/main.yml | 2 ++ tests/requirements-2.10.txt | 2 +- tests/requirements-2.11.txt | 2 +- tests/requirements-2.9.txt | 2 +- 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/roles/kubernetes/kubeadm/tasks/main.yml b/roles/kubernetes/kubeadm/tasks/main.yml index 600e0dc7b..15a20cbd7 100644 --- a/roles/kubernetes/kubeadm/tasks/main.yml +++ b/roles/kubernetes/kubeadm/tasks/main.yml @@ -78,6 +78,7 @@ --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests --skip-phases={{ kubeadm_join_phases_skip | join(',') }} register: kubeadm_join + changed_when: kubeadm_join is success rescue: @@ -89,6 +90,7 @@ --ignore-preflight-errors=all --skip-phases={{ kubeadm_join_phases_skip | join(',') }} register: kubeadm_join + changed_when: kubeadm_join is success always: diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index 7122744f0..c0963815e 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -148,6 +148,7 @@ - name: reset | force remove all cri pods (rescue) shell: "ip netns list | cut -d' ' -f 1 | xargs -n1 ip netns delete && {{ bin_dir }}/crictl rmp -a -f" ignore_errors: true # noqa ignore-errors + changed_when: true - name: reset | stop etcd services service: diff --git a/roles/upgrade/pre-upgrade/tasks/main.yml b/roles/upgrade/pre-upgrade/tasks/main.yml index 9aad57e0e..d41f0fa24 100644 --- a/roles/upgrade/pre-upgrade/tasks/main.yml +++ b/roles/upgrade/pre-upgrade/tasks/main.yml @@ -50,6 +50,7 @@ - name: Cordon node command: "{{ kubectl }} cordon {{ kube_override_hostname|default(inventory_hostname) }}" delegate_to: "{{ groups['kube_control_plane'][0] }}" + changed_when: true - name: Check kubectl version command: "{{ kubectl }} version --client --short" @@ -110,6 +111,7 @@ until: drain_fallback_result.rc == 0 retries: "{{ drain_fallback_retries }}" delay: "{{ drain_fallback_retry_delay_seconds }}" + changed_when: drain_fallback_result.rc == 0 when: - drain_nodes - drain_fallback_enabled diff --git a/tests/requirements-2.10.txt b/tests/requirements-2.10.txt index e139e1fa6..03f0aa0fa 100644 --- a/tests/requirements-2.10.txt +++ b/tests/requirements-2.10.txt @@ -4,7 +4,7 @@ apache-libcloud==2.2.1 tox==3.11.1 dopy==0.3.7 cryptography==2.8 -ansible-lint==5.0.11 +ansible-lint==5.4.0 openshift==0.8.8 molecule==3.0.6 molecule-vagrant==0.3 diff --git a/tests/requirements-2.11.txt b/tests/requirements-2.11.txt index b58e0f2c1..a652be39e 100644 --- a/tests/requirements-2.11.txt +++ b/tests/requirements-2.11.txt @@ -4,7 +4,7 @@ apache-libcloud==2.2.1 tox==3.11.1 dopy==0.3.7 cryptography==2.8 -ansible-lint==5.0.11 +ansible-lint==5.4.0 openshift==0.8.8 molecule==3.0.6 molecule-vagrant==0.3 diff --git a/tests/requirements-2.9.txt b/tests/requirements-2.9.txt index 9ae13b5b2..dff1f6612 100644 --- a/tests/requirements-2.9.txt +++ b/tests/requirements-2.9.txt @@ -4,7 +4,7 @@ apache-libcloud==2.2.1 tox==3.11.1 dopy==0.3.7 cryptography==2.8 -ansible-lint==5.0.11 ; python_version >= '3.0' +ansible-lint==5.4.0 ; python_version >= '3.0' ansible-lint==4.2.0 ; python_version < '3.0' openshift==0.8.8 molecule==3.0.6 ; python_version >= '3.0'