From 64bee9cb860565b366065989885eaca0858df61f Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Sat, 9 Mar 2019 08:55:12 +0100 Subject: [PATCH] osd: backward compatibility with old disk_list.sh location 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 (cherry picked from commit 987bdac963cee8d8aba1f10659f23bb68c2b1d1b) --- roles/ceph-osd/tasks/docker/start_docker_osd.yml | 12 +++++++++++- roles/ceph-osd/vars/main.yml | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 roles/ceph-osd/vars/main.yml diff --git a/roles/ceph-osd/tasks/docker/start_docker_osd.yml b/roles/ceph-osd/tasks/docker/start_docker_osd.yml index c24e7db01..0bfb8e6e1 100644 --- a/roles/ceph-osd/tasks/docker/start_docker_osd.yml +++ b/roles/ceph-osd/tasks/docker/start_docker_osd.yml @@ -10,11 +10,21 @@ when: - ceph_docker_on_openstack +- name: test if the container image has directory {{ container_bin_path }} + command: "docker run --rm --net=host --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 --net=host --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 + when: + - osd_scenario != 'lvm' - name: generate ceph osd docker run script become: true diff --git a/roles/ceph-osd/vars/main.yml b/roles/ceph-osd/vars/main.yml new file mode 100644 index 000000000..d26a09fd5 --- /dev/null +++ b/roles/ceph-osd/vars/main.yml @@ -0,0 +1,2 @@ +--- +container_bin_path: /opt/ceph-container/bin