From: Sébastien Han Date: Tue, 2 Oct 2018 16:10:19 +0000 (+0200) Subject: handler: add support for ceph-volume containerized restart X-Git-Tag: v3.2.0beta5~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2bea8d8ecf3e97d8635ecb3f81ebf838ffa176ea;p=ceph-ansible.git handler: add support for ceph-volume containerized restart The restart script wasn't working with the current new addition of ceph-volume in container where now OSDs have the OSD id name in the container name. Signed-off-by: Sébastien Han --- diff --git a/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 b/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 index 15b255900..09de06d5c 100644 --- a/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 +++ b/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 @@ -66,12 +66,16 @@ for unit in $(systemctl list-units | grep -E "loaded * active" | grep -oE "ceph- # We need to wait because it may take some time for the socket to actually exists COUNT=10 # Wait and ensure the socket exists after restarting the daemon - {% if containerized_deployment -%} + {% if containerized_deployment and osd_scenario != 'lvm' -%} id=$(get_dev_name "$unit") container_id=$(get_docker_id_from_dev_name "$id") wait_for_socket_in_docker "$container_id" osd_id=$whoami docker_exec="docker exec $container_id" + {% elif containerized_deployment and osd_scenario == 'lvm' %} + osd_id=$(echo ${unit#ceph-osd@} | grep -oE '[0-9]+') + container_id=$(get_docker_id_from_dev_name "ceph-osd-${osd_id}") + docker_exec="docker exec $container_id" {% else %} osd_id=$(echo ${unit#ceph-osd@} | grep -oE '[0-9]+') {% endif %}