]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
fix grep match pattern for osd ids 1316/head
authorShengjing Zhu <zsj950618@gmail.com>
Mon, 20 Feb 2017 08:35:56 +0000 (16:35 +0800)
committerShengjing Zhu <zsj950618@gmail.com>
Mon, 20 Feb 2017 08:35:56 +0000 (16:35 +0800)
Some playbooks use [0-9]*, others use \d+$
The latter is more correct since cluster name may contain numbers.

Signed-off-by: Shengjing Zhu <zsj950618@gmail.com>
infrastructure-playbooks/purge-cluster.yml
roles/ceph-common/handlers/restart-osd.yml
roles/ceph-common/handlers/validate-osd.yml

index f27925834afee54e90fb73627595205c3c79edbe..8bd1471eb438caddac193e653d879f1e9a4ab3e5 100644 (file)
 
   - name: stop ceph osds on ubuntu
     shell: |
-      for id in $(ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'); do
+      for id in $(ls /var/lib/ceph/osd/ |grep -oP '\d+$'); do
         initctl stop ceph-osd cluster={{ cluster }} id=$id
       done
     failed_when: false
index dc6fbeebb146b8fe4eefdbe11093e8340547f471..ad2fd4ffc1a1006c66f79958618e25b0e466ee6a 100644 (file)
@@ -4,7 +4,7 @@
 # for restarting them specifically.
 - name: restart ceph osds
   shell: |
-    for id in $(ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'); do
+    for id in $(ls /var/lib/ceph/osd/ |grep -oP '\d+$'); do
       systemctl restart ceph-osd@$id
       sleep 5
     done
index 99d1c2f871d09e5100ed5795ce8fc6abf5c7f4a8..88881212c11a60ee3b594bfb97c0bf4c943f875f 100644 (file)
@@ -1,7 +1,7 @@
 ---
 - name: collect osds
   shell: |
-    ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'
+    ls /var/lib/ceph/osd/ |grep -oP '\d+$'
   register: osd_ids
 
 - name: wait for ceph osd socket(s)