From: Guillaume Abrioux Date: Wed, 31 Jul 2019 07:31:50 +0000 (+0200) Subject: lint: fix error [306], add pipefail on shell command using pipe X-Git-Tag: v4.0.0rc14~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8f781198d6634543c5ccdbefb3c4eef9e2ea9660;p=ceph-ansible.git lint: fix error [306], add pipefail on shell command using pipe This commit fixes the error [306]: `[306] Shells that use pipes should set the pipefail option` using `/bin/bash` as executable because Debian/Ubuntu systems use `dash` by default which doesn't have the `-o pipefail`. (See: https://github.com/ansible/ansible-lint/issues/497#issue-424623501) Signed-off-by: Guillaume Abrioux (cherry picked from commit 102edaeb614f3203202ad6b19dec07bb57cfaf9e) --- diff --git a/roles/ceph-osd/tasks/start_osds.yml b/roles/ceph-osd/tasks/start_osds.yml index 7e7ce5022..b38b7071e 100644 --- a/roles/ceph-osd/tasks/start_osds.yml +++ b/roles/ceph-osd/tasks/start_osds.yml @@ -23,7 +23,10 @@ # this is for ceph-disk, the ceph-disk command is gone so we have to list /var/lib/ceph - name: get osd ids shell: | + set -o pipefail; ls /var/lib/ceph/osd/ | sed 's/.*-//' + args: + executable: /bin/bash changed_when: false register: osd_ids_non_container