From 535b4103633043a162791848c6564f6b80ce675d Mon Sep 17 00:00:00 2001 From: Roxyrob <22431069+Roxyrob@users.noreply.github.com> Date: Tue, 16 Mar 2021 23:24:24 +0100 Subject: [PATCH] * Fix: follow best practice for pipe in shell command --- tasks/centos.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tasks/centos.yml b/tasks/centos.yml index dd8fba3..e39ff08 100644 --- a/tasks/centos.yml +++ b/tasks/centos.yml @@ -6,14 +6,22 @@ become: true - name: centos | check for nvme devices - shell: cat /proc/partitions |awk '{print $4}' | grep -q nvme. ; echo $? + shell: | + set -o pipefail + cat /proc/partitions | awk '{print $4}' | grep -q nvme. ; echo $? + args: + executable: /bin/bash register: blkdev_nvme changed_when: false - name: centos | check for amazon ebs devices - shell: lsblk -O -J| grep -qi "amazon elastic block store" ; echo $? + shell: | + set -o pipefail + lsblk -O -J | grep -qi "amazon elastic block store" ; echo $? register: blkdev_awsebs changed_when: false + args: + executable: /bin/bash - name: centos | set flag for nvme subsystem set_fact: