Skip to content

Commit cae407c

Browse files
committed
Fix ansible-lint violations in existing roles
- Add changed_when: true to two tasks in get_openshift_release_binaries - Add set -o pipefail to shell tasks with pipes in run-performance-test - Replace ignore_errors with failed_when: false in DUT pod cleanup Ref: OSPRH-32049 Change-Id: I7320ee163f4a2811f7dd7d535424fabb2c2e694e Signed-off-by: Itay Matza <imatza@redhat.com>
1 parent 3fee09f commit cae407c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

collection/stages/roles/day2ops/tasks/procedures/run-performance-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090

9191
- name: Collect SRIOV DUT port MACs
9292
ansible.builtin.shell: |
93+
set -o pipefail
9394
oc --kubeconfig {{ kubeconfig }} logs {{ perf_test.sriov.pod_name }} -n default | grep -E "^Port [0-9]" | grep -v "link state change"
9495
register: _sriov_macs
9596
retries: 10
@@ -202,6 +203,7 @@
202203

203204
- name: Collect DPDK DUT port MACs
204205
ansible.builtin.shell: |
206+
set -o pipefail
205207
oc --kubeconfig {{ kubeconfig }} logs {{ perf_test.dpdk.pod_name }} -n default | grep -E "^Port [0-9]" | grep -v "link state change"
206208
register: _dpdk_macs
207209
retries: 10
@@ -271,4 +273,4 @@
271273
loop:
272274
- "{{ perf_test.sriov.pod_name }}"
273275
- "{{ perf_test.dpdk.pod_name }}"
274-
ignore_errors: true
276+
failed_when: false

collection/tools/roles/tools_get_openshift_release/tasks/get_openshift_release_binaries.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
when: openshift_release_pull_spec is not defined or openshift_release_pull_spec == ''
2828

2929
- name: Extract pull secret from host cluster via Kubernetes API
30+
changed_when: true
3031
ansible.builtin.shell: |
3132
python3 << 'PYEOF'
3233
import yaml, json, base64, subprocess, os, sys, tempfile
@@ -127,6 +128,7 @@
127128
mode: u=rwx,g=rw,o=r
128129

129130
- name: Extract OCP tools from release image {{ openshift_release_pull_spec }}
131+
changed_when: true
130132
ansible.builtin.command:
131133
cmd: >-
132134
timeout 900

0 commit comments

Comments
 (0)