]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
playbook: homogenize the way list osd ids
authorSébastien Han <seb@redhat.com>
Thu, 30 Mar 2017 09:51:38 +0000 (11:51 +0200)
committerSébastien Han <seb@redhat.com>
Thu, 30 Mar 2017 09:51:38 +0000 (11:51 +0200)
Problem: too many different commands to do the same thing. The 'cut'
command on infrastructure-playbooks/purge-cluster.yml was also wrong.
This sed command from osixia in ceph-docker
https://github.com/ceph/ceph-docker/pull/580/ addresses all the
scenarios.

Signed-off-by: Sébastien Han <seb@redhat.com>
handlers/restart-osd.yml
handlers/validate-osd.yml

index 89c05303b1526ad58a87cfddbc9238620a47956f..93641f92696c3c497f5966d81e980956880aae99 100644 (file)
@@ -4,7 +4,7 @@
 # for restarting them specifically.
 - name: restart ceph osds
   shell: |
-    for id in $(ls /var/lib/ceph/osd/ |grep -oP '\d+$'); do
+    for id in $(ls /var/lib/ceph/osd/ | sed 's/.*-//'); do
       systemctl restart ceph-osd@$id
       sleep 5
     done
index 88881212c11a60ee3b594bfb97c0bf4c943f875f..aefe1b9bef270c93ccda71465b41b50924295075 100644 (file)
@@ -1,7 +1,7 @@
 ---
 - name: collect osds
   shell: |
-    ls /var/lib/ceph/osd/ |grep -oP '\d+$'
+    ls /var/lib/ceph/osd/ | sed 's/.*-//'
   register: osd_ids
 
 - name: wait for ceph osd socket(s)