From 15b89984aa39402e3284260a67c6cf01668ef9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?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=UTF-8 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 (cherry picked from commit 0e2e270ab238f63285422fed90fc773d9e4ae0be) --- 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 8fd30dfda..1637d7edc 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