]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
handler: add support for ceph-volume containerized restart
authorSébastien Han <seb@redhat.com>
Tue, 2 Oct 2018 16:10:19 +0000 (18:10 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 10 Oct 2018 20:08:41 +0000 (16:08 -0400)
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 <seb@redhat.com>
roles/ceph-handler/templates/restart_osd_daemon.sh.j2

index 15b255900ddac35fda750b37781f85b2ea8d97e0..09de06d5cf13106c9d06c1dd707cd0440c82aca9 100644 (file)
@@ -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 %}