From: Sébastien Han Date: Mon, 3 Oct 2016 14:48:04 +0000 (+0200) Subject: fix non skipped task for ansible v1.9.x X-Git-Tag: v1.0.7~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F994%2Fhead;p=ceph-ansible.git fix non skipped task for ansible v1.9.x please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1376283 Signed-off-by: Sébastien Han --- 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