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"