]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
shrink-osd: check osd id format
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 12 Oct 2021 15:55:40 +0000 (17:55 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 12 Oct 2021 16:26:18 +0000 (18:26 +0200)
This adds a check early in order to ensure the format of osd ids passed
is correct.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2005734
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/shrink-osd.yml

index 970268afade82d1a3efc19507694fa3a4d93522a..75ad7a4a2c7cb670c01e23f06354d452bba9eae7 100644 (file)
            -e osd_to_kill=0,1,2,3 argument."
       when: osd_to_kill is not defined
 
+    - name: check the osd ids passed have the correct format
+      fail:
+        msg: "The id {{ item }} has wrong format, please pass the number only"
+      with_items: "{{ osd_to_kill.split(',') }}"
+      when: not item is regex("^\d$")
+
   tasks:
     - import_role:
         name: ceph-defaults