mirror of https://github.com/ceph/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 <gabrioux@redhat.com>pull/2962/head
parent
f6b6f7d5b0
commit
102edaeb61
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue