]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: backward compatibility with old disk_list.sh location
authorGuillaume Abrioux <gabrioux@redhat.com>
Sat, 9 Mar 2019 07:55:12 +0000 (08:55 +0100)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Mon, 18 Mar 2019 21:56:53 +0000 (21:56 +0000)
Since all files in container image have moved to `/opt/ceph-container`
this check must look for new AND the old path so it's backward
compatible. Otherwise it could end up by templating an inconsistent
`ceph-osd-run.sh`.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 987bdac963cee8d8aba1f10659f23bb68c2b1d1b)

roles/ceph-osd/tasks/start_osds.yml
roles/ceph-osd/vars/main.yml [new file with mode: 0644]

index 2e3e1ecc2faf7bc83ff7f8f85ce7a9e00b9bcca4..fb4cc05d1799a0a3f40c7173f61ac88d6c2c10ea 100644 (file)
     when:
       - ceph_docker_on_openstack
 
+  - name: test if the container image has directory {{ container_bin_path }}
+    command: "docker run --rm --entrypoint=test {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -d {{ container_bin_path }}"
+    changed_when: false
+    failed_when: false
+    register: test_container_bin_path
+    when:
+      - osd_scenario != 'lvm'
+
   - name: test if the container image has the disk_list function
-    command: docker run --rm --entrypoint=stat {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} disk_list.sh
+    command: "docker run --rm --entrypoint=stat {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ container_bin_path + '/disk_list.sh' if test_container_bin_path.rc == 0 else 'disk_list.sh' }}"
     changed_when: false
     failed_when: false
     register: disk_list
diff --git a/roles/ceph-osd/vars/main.yml b/roles/ceph-osd/vars/main.yml
new file mode 100644 (file)
index 0000000..d26a09f
--- /dev/null
@@ -0,0 +1,2 @@
+---
+container_bin_path: /opt/ceph-container/bin