]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Get the correct OSD ID when the cluster name includes numbers 750/head
authorAndrew Schoen <aschoen@redhat.com>
Tue, 3 May 2016 19:47:47 +0000 (14:47 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 3 May 2016 19:47:47 +0000 (14:47 -0500)
If the ceph cluster name includes numbers, the grep used to find the OSD
IDs from /var/lib/ceph/osd/ would also return the numbers that were in
the cluster name.

For example, if the cluster was named 'mine123' and there was only one
OSD on the node, then the task that finds the OSD IDs would return
'123' and '0'.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/ceph-osd/tasks/activate_osds.yml

index 9473b2e7abfa6dd0c311c3c7ea500e9d8d0624b6..1a8841f2480fe3534b0a2896f92c729ed3c11be8 100644 (file)
@@ -69,7 +69,7 @@
     is_before_infernalis
 
 - name: get osd id (for or after infernalis)
-  shell: "ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'"
+  shell: "ls /var/lib/ceph/osd/ | grep '-' | cut -d '-' -f 2"
   changed_when: false
   failed_when: false
   register: osd_id