From 4a181d420d7d0f8361d24f274c0e952b9d956945 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Tue, 3 May 2016 14:47:47 -0500 Subject: [PATCH] Get the correct OSD ID when the cluster name includes numbers 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 --- roles/ceph-osd/tasks/activate_osds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index 9473b2e7a..1a8841f24 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -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