]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
fix fragment for osd directory scenario
authorSébastien Han <seb@redhat.com>
Mon, 7 Mar 2016 23:40:50 +0000 (00:40 +0100)
committerSébastien Han <seb@redhat.com>
Mon, 7 Mar 2016 23:40:50 +0000 (00:40 +0100)
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-osd/tasks/osd_fragment.yml

index b219b6120ebdc56335400537f63517e6ffd18869..7c77be19350ff4e16cb47ed0bc070ecaa711248d 100644 (file)
@@ -5,13 +5,29 @@
   changed_when: false
   failed_when: false
   register: osd_path
+  when: not osd_directory
 
 - name: get osd id
   command: cat {{ item.stdout }}/whoami
   with_items: osd_path.results
   changed_when: false
   failed_when: false
-  register: osd_id
+  register: osd_id_non_dir_scenario
+  when: not osd_directory
+
+- name: get osd id for directory scenario
+  command: cat {{ item.stdout }}/whoami
+  with_items: osd_directories
+  changed_when: false
+  failed_when: false
+  register: osd_id_dir_scenario
+  when: osd_directory
+
+# NOTE (leseb): we must do this because of
+# https://github.com/ansible/ansible/issues/4297
+- name: combine osd_path results
+  set_fact:
+    combined_osd_id: "{{ osd_id_non_dir_scenario if not osd_directory else osd_id_dir_scenario }}"
 
 - name: create a ceph fragment and assemble directory
   file:
@@ -28,7 +44,7 @@
   template:
     src: osd.conf.j2
     dest: /etc/ceph/ceph.d/osd_fragments/osd.{{ item.stdout }}.conf
-  with_items: osd_id.results
+  with_items: combined_osd_id.results
 
 - name: copy ceph.conf for assembling
   command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/