osd: fix autodiscovery disk

Signed-off-by: Sébastien Han <seb@redhat.com>
Co-Authored-By: Christoph Dwertmann
pull/1006/head
Sébastien Han 2016-10-05 18:16:30 +02:00
parent 598d78cef3
commit 860303c265
2 changed files with 5 additions and 5 deletions

View File

@ -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:

View File

@ -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"