From f162db1202a050d363820fc838e7df41ff9ce3d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Mon, 3 Oct 2016 16:48:04 +0200 Subject: [PATCH] fix non skipped task for ansible v1.9.x MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1376283 Signed-off-by: Sébastien Han --- roles/ceph-osd/tasks/activate_osds.yml | 6 +++--- roles/ceph-osd/tasks/check_devices.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index f4aff7191..b80548dc6 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -63,7 +63,7 @@ msg: "ceph-disk failed to create an OSD" when: " 'ceph-disk: Error: ceph osd create failed' in item.get('stderr', '') " - with_items: "{{ combined_activate_osd_disk_results.results }}" + with_items: "{{ (combined_activate_osd_disk_results|default({})).results|default([]) }}" # NOTE (leseb): this task is for partitions because we don't explicitly use a partition. - name: activate osd(s) when device is a partition @@ -113,7 +113,7 @@ command: systemctl enable ceph-osd@{{ item }} changed_when: false failed_when: false - with_items: "{{ osd_id.stdout_lines }}" + with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}" when: - use_systemd - is_after_hammer @@ -123,7 +123,7 @@ name: ceph-osd@{{ item }} state: started enabled: yes - with_items: "{{ osd_id.stdout_lines }}" + with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}" changed_when: false when: - use_systemd diff --git a/roles/ceph-osd/tasks/check_devices.yml b/roles/ceph-osd/tasks/check_devices.yml index 4a07ea49a..07ccdd6ce 100644 --- a/roles/ceph-osd/tasks/check_devices.yml +++ b/roles/ceph-osd/tasks/check_devices.yml @@ -22,7 +22,7 @@ - name: check the partition status of the journal devices shell: "parted --script {{ item }} print > /dev/null 2>&1" - with_items: "{{ raw_journal_devices }}" + with_items: "{{ raw_journal_devices|default([])|unique }}" changed_when: false failed_when: false register: journal_partition_status -- 2.39.5