Skip to content

Commit

Permalink
fix ansible lint: ignore risky-shell-pipe
Browse files Browse the repository at this point in the history
Ignoring because when using 'set -o pipefail &&' the task fails due to
non zero return code
  • Loading branch information
dangel101 authored and mwperina committed Oct 27, 2022
1 parent cccd7a9 commit 0a578cb
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
- name: Check for system updates (remove empty lines) on EL7
ansible.builtin.shell: >
set -o pipefail && \
ansible.builtin.shell: # noqa risky-shell-pipe
>
yum check-update -q --exclude=ansible | grep '^[a-zA-Z0-9\_\-]\+[.][a-zA-Z0-9\_\-]\+' | cut -d ' ' -f1 |
sed '/^$/d' >> /tmp/yum_updates
args:
executable: /bin/bash
register: yum_updates_res
when: el_ver | int == 7
failed_when: "'rc' in yum_updates_res and yum_updates_res.rc == 1"
Expand All @@ -18,11 +16,9 @@
# For example, Packages that will be found: redhat-virtualization-host-image-update.noarch, tar-1.32-6.fc33.x86_64
# NetworkManager.x86_64, cockpit.x86_64
- name: Check for system updates (remove empty lines)
ansible.builtin.shell: >
set -o pipefail && \
ansible.builtin.shell: # noqa risky-shell-pipe
>
yum check-update -q | grep '^[a-zA-Z0-9\_\-]\+[.][a-zA-Z0-9\_\-]\+' | cut -d ' ' -f1 | sed '/^$/d' >> /tmp/yum_updates
args:
executable: /bin/bash
register: yum_updates_res
when: el_ver | int != 7
failed_when: "'rc' in yum_updates_res and yum_updates_res.rc == 1"
Expand Down

0 comments on commit 0a578cb

Please sign in to comment.