mirror of https://github.com/ceph/ceph-ansible.git
shrink-osd: check osd id format
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> (cherry picked from commit4.2z3968891f449
) (cherry picked from commit3f4abb09b4
)
parent
54d9643439
commit
bf8b35cc6e
|
@ -54,6 +54,12 @@
|
|||
-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
|
||||
|
|
Loading…
Reference in New Issue