From: Guillaume Abrioux Date: Tue, 12 Oct 2021 15:55:40 +0000 (+0200) Subject: shrink-osd: check osd id format X-Git-Tag: v4.0.68~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3f4abb09b400dcf7563d2f662815d556cd4bf5bc;p=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 (cherry picked from commit 968891f4498da9625acfdd34bfb01fe445d1eef2) --- diff --git a/infrastructure-playbooks/shrink-osd.yml b/infrastructure-playbooks/shrink-osd.yml index 6dd00b3b0..1526d769b 100644 --- a/infrastructure-playbooks/shrink-osd.yml +++ b/infrastructure-playbooks/shrink-osd.yml @@ -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