]> 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
authorAndrew Schoen <aschoen@redhat.com>
Tue, 3 May 2016 19:47:47 +0000 (14:47 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 4 May 2016 16:03:33 +0000 (11:03 -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>
(cherry picked from commit 4a181d420d7d0f8361d24f274c0e952b9d956945)

roles/ceph-osd/tasks/activate_osds.yml

index 47e488cfca7c1b93dec4ae90139c0f71d2a44b87..81c9ea36eebfb6a194d50ead5e99bdf12f5f73fe 100644 (file)
@@ -69,7 +69,7 @@
     not is_ceph_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