From 4052ab29f233f49ac4378d7f084801a122697e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= Date: Tue, 28 Jul 2020 13:47:26 +0200 Subject: [PATCH] shrink-osd: various fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This handles missing /etc/ceph/osd, by ensuring we actually found files in `/etc/ceph/osd` before trying to slurp their content. This also add a missing `| default(False)` to avoid fowlloing error: ``` fatal: [ceph01]: FAILED! => msg: |- The conditional check 'ceph_osd_data_json[item.2]['encrypted'] | bool' failed. The error was: error while evaluating conditional (ceph_osd_data_json[item.2]['encrypted'] | bool): 'dict object' has no attribute 'encrypted' ``` Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1862416 Signed-off-by: BenoƮt Knecht (cherry picked from commit fe8fbd3ee2d877c9ca3b08412a8b12f64a111c18) --- infrastructure-playbooks/shrink-osd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infrastructure-playbooks/shrink-osd.yml b/infrastructure-playbooks/shrink-osd.yml index 68aeb9a06..23ab07cf3 100644 --- a/infrastructure-playbooks/shrink-osd.yml +++ b/infrastructure-playbooks/shrink-osd.yml @@ -123,7 +123,9 @@ delegate_to: "{{ item.item.0 }}" register: ceph_osd_files_content loop: "{{ ceph_osd_data.results }}" - when: item.skipped is undefined + when: + - item.skipped is undefined + - item.matched > 0 - name: set_fact ceph_osd_files_json set_fact: @@ -191,7 +193,7 @@ until: result is succeeded when: - item.2 not in _lvm_list.keys() - - ceph_osd_data_json[item.2]['encrypted'] | bool + - ceph_osd_data_json[item.2]['encrypted'] | default(False) | bool - ceph_osd_data_json[item.2][item.3] is defined - name: use ceph-volume lvm zap to destroy all partitions