]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
lint: fix error [306], add pipefail on shell command using pipe
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 31 Jul 2019 07:31:50 +0000 (09:31 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 22 Aug 2019 22:23:47 +0000 (00:23 +0200)
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 <gabrioux@redhat.com>
roles/ceph-osd/tasks/start_osds.yml

index 7e7ce5022bd5d4c618241b83725a7ebc18be264a..b38b7071e0dc4f32790f325247a9d07ec63d5ba4 100644 (file)
 # 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