From 0e2e270ab238f63285422fed90fc773d9e4ae0be Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Fri, 27 Jan 2017 11:21:04 +0100 Subject: [PATCH] purge: allow purge to run multiple times MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit with_items is evaluated before the when so in a second run where the variable is empty if will fail with "'dict object' has no attribute 'stdout_lines'". To fix this we had a default array so with_items does not fail and the task is skipped with the when. Signed-off-by: Sébastien Han --- infrastructure-playbooks/purge-cluster.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index 70a3893dd..0de3f002e 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -436,7 +436,7 @@ raw_device=$(echo "{{ item }}" | egrep -o '/dev/([hsv]d[a-z]{1,2}|cciss/c[0-9]d[0-9]p|nvme[0-9]n[0-9]p){1,2}') partition_nb=$(echo "{{ item }}" | egrep -o '[0-9]{1,2}$') sgdisk --delete $partition_nb $raw_device - with_items: "{{ ceph_journal_partition_to_erase_path.stdout_lines }}" + with_items: "{{ ceph_journal_partition_to_erase_path.stdout_lines | default([]) }}" when: - ceph_journal_partlabels.rc == 0 - raw_multi_journal is defined -- 2.39.5