]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge-cluster: clean some code
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 13 Dec 2017 14:23:47 +0000 (15:23 +0100)
committerSébastien Han <seb@redhat.com>
Wed, 20 Dec 2017 16:42:45 +0000 (17:42 +0100)
Avoid using regexp to match device

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/purge-cluster.yml

index ffa6daddc1b14fe396f94e5742ded0a8a6010fec..c04c408a5a95d9b9a3b3f7f6a3efa1246cde0448 100644 (file)
 
   - name: get ceph data partitions
     shell: |
-      blkid | awk -F: '/ceph data/ { print $1 }'
+      blkid -o device -t PARTLABEL="ceph data"
     failed_when: false
     register: ceph_data_partition_to_erase_path
 
   - name: get ceph lockbox partitions
     shell: |
-      blkid | awk '/ceph lockbox/ { sub (":", "", $1); print $1 }'
+      blkid -o device -t PARTLABEL="ceph lockbox"
     failed_when: false
     register: ceph_lockbox_partition_to_erase_path
 
 
   - name: get ceph block partitions
     shell: |
-      blkid | awk '/ceph block"/ { sub (":", "", $1); print $1 }'
+      blkid -o device -t PARTLABEL="ceph block"
     failed_when: false
     register: ceph_block_partition_to_erase_path
 
   - name: get ceph journal partitions
     shell: |
-      blkid | awk '/ceph journal/ { sub (":", "", $1); print $1 }'
+      blkid -o device -t PARTLABEL="ceph journal"
     failed_when: false
     register: ceph_journal_partition_to_erase_path
 
   - name: get ceph db partitions
     shell: |
-      blkid | awk '/ceph block.db/ { sub (":", "", $1); print $1 }'
+      blkid -o device -t PARTLABEL="ceph block.db"
     failed_when: false
     register: ceph_db_partition_to_erase_path
 
   - name: get ceph wal partitions
     shell: |
-      blkid | awk '/ceph block.wal/ { sub (":", "", $1); print $1 }'
+      blkid -o device -t PARTLABEL="ceph block.wal"
     failed_when: false
     register: ceph_wal_partition_to_erase_path