ansible-lint: Fix ignore-errors failures

In some test playbooks, the `ignore_errors: true` can not be replaced
by `changed_when: false`, because `changed_when` is not a valid
attribute for a IncludeRole.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
Wen Liang 2023-03-14 19:33:39 -04:00 committed by Fernando Fernández Mancera
parent 8a3dd3c438
commit 8eed9ae4a9
19 changed files with 25 additions and 25 deletions

View file

@ -30,7 +30,7 @@
command: "{{ coverage }} combine"
environment:
COVERAGE_FILE: "{{ coverage_file }}"
ignore_errors: true
failed_when: false
changed_when: false
- name: remove old data

View file

@ -112,7 +112,7 @@
- name: "{{ interface }}"
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent

View file

@ -106,7 +106,7 @@
- name: br1
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- include_tasks: tasks/cleanup_802_1x_server.yml
- name: Remove test certificates
file:

View file

@ -101,9 +101,9 @@
- name: "{{ controller_profile }}"
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- command: ip link del {{ controller_device }}
ignore_errors: true
failed_when: false
- import_tasks: tasks/remove_test_interfaces_with_dhcp.yml
- name: "Restore the /etc/resolv.conf for initscript"
command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf

View file

@ -120,9 +120,9 @@
- name: "{{ controller_profile }}"
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- command: ip link del {{ controller_device }}
ignore_errors: true
failed_when: false
- import_tasks: tasks/remove_test_interfaces_with_dhcp.yml
- name: Restore the /etc/resolv.conf for initscript
command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf

View file

@ -97,7 +97,7 @@
- name: "{{ controller_profile }}"
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- command: ip link del {{ controller_device }}
ignore_errors: true
failed_when: false
- import_tasks: tasks/remove_test_interfaces_with_dhcp.yml

View file

@ -188,7 +188,7 @@
- name: "{{ controller_profile }}"
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- command: ip link del {{ controller_device }}
ignore_errors: true
failed_when: false
- import_tasks: tasks/remove_test_interfaces_with_dhcp.yml

View file

@ -235,9 +235,9 @@
- name: "{{ controller_profile }}"
state: down
persistent_state: absent
ignore_errors: true
failed_when: false
- command: ip link del {{ controller_device }}
ignore_errors: true
failed_when: false
- import_tasks: tasks/remove_test_interfaces_with_dhcp.yml
- name: "Restore the /etc/resolv.conf for initscript"
command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf

View file

@ -74,7 +74,7 @@
always:
- tags:
- "tests::cleanup"
ignore_errors: true
ignore_errors: true # noqa ignore-errors
block:
# Use internal module directly for speedup
- network_connections:

View file

@ -75,4 +75,4 @@
- name: pseudo-pci-test-only
persistent_state: absent
state: down
ignore_errors: true
failed_when: false

View file

@ -155,7 +155,7 @@
network_connections:
- name: "{{ interface }}"
persistent_state: absent
ignore_errors: true
failed_when: false
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent

View file

@ -202,7 +202,7 @@
- name: "{{ interface }}"
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent

View file

@ -193,7 +193,7 @@
network_connections:
- name: "{{ interface }}"
persistent_state: absent
ignore_errors: true
failed_when: false
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent

View file

@ -76,6 +76,6 @@
- name: ib0-10
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- command: ip link del ib0.000a
ignore_errors: true
failed_when: false

View file

@ -156,4 +156,4 @@
- name: br-example
persistent_state: absent
state: down
ignore_errors: true
failed_when: false

View file

@ -59,7 +59,7 @@
always:
- tags:
- "tests::cleanup"
ignore_errors: true
ignore_errors: true # noqa ignore-errors
block:
# Use internal module directly for speedup
- network_connections:

View file

@ -88,5 +88,5 @@
- name: "{{ interface }}"
persistent_state: absent
state: down
ignore_errors: true
failed_when: false
- include_tasks: tasks/cleanup_mock_wifi.yml

View file

@ -65,7 +65,7 @@
- name: "{{ interface }}"
persistent_state: absent
state: down
ignore_errors: true
ignore_errors: true # noqa ignore-errors
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent

View file

@ -10,7 +10,7 @@
name: "{{ item }}"
state: present
# Ignore error because some package names might not be available
ignore_errors: true
ignore_errors: true # noqa ignore-errors
loop:
- NetworkManager-libnm
- python2-gobject-base