From 860303c26543c18d2a8c9994399526ab6502fb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 5 Oct 2016 18:16:30 +0200 Subject: [PATCH] osd: fix autodiscovery disk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han Co-Authored-By: Christoph Dwertmann --- roles/ceph-osd/tasks/activate_osds.yml | 8 ++++---- roles/ceph-osd/tasks/check_devices_auto.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index c8a424610..dab0ee529 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -3,7 +3,7 @@ # partition. - name: automatically activate osd disk(s) without partitions - command: ceph-disk activate "/dev/{{ item.key }}" + command: ceph-disk activate "/dev/{{ item.key | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1" ignore_errors: true with_dict: ansible_devices when: @@ -17,7 +17,7 @@ command: ceph-disk activate {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1 with_together: - "{{ ispartition_results.results }}" - - "{{ devices }}" + - "{{ devices|default([])|unique }}" changed_when: false failed_when: false register: activate_osd_disk @@ -42,7 +42,7 @@ command: ceph-disk activate --dmcrypt {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1 with_together: - "{{ ispartition_results.results }}" - - "{{ devices }}" + - "{{ devices|default([])|unique }}" changed_when: false failed_when: false register: activate_osd_disk_dmcrypt @@ -70,7 +70,7 @@ command: "ceph-disk activate {{ item.1 }}" with_together: - "{{ ispartition_results.results }}" - - "{{ devices }}" + - "{{ devices|default([])|unique }}" changed_when: false failed_when: false when: diff --git a/roles/ceph-osd/tasks/check_devices_auto.yml b/roles/ceph-osd/tasks/check_devices_auto.yml index ec80f85ea..ae6807dd9 100644 --- a/roles/ceph-osd/tasks/check_devices_auto.yml +++ b/roles/ceph-osd/tasks/check_devices_auto.yml @@ -4,7 +4,7 @@ with_dict: "{{ ansible_devices }}" changed_when: false failed_when: false - register: "{{ ispartition_results }}" + register: ispartition_results when: - ansible_devices is defined - item.value.removable == "0"