]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: change unit template for ceph-volume container
authorSébastien Han <seb@redhat.com>
Fri, 28 Sep 2018 16:05:42 +0000 (18:05 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 10 Oct 2018 20:08:41 +0000 (16:08 -0400)
We don't need to pass the hostname on the container name but we can keep
it simple and just call it ceph-osd-$id.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-osd/templates/ceph-osd.service.j2

index 0e7dae3f033a38bfe6484c6fa1a84220c909559f..d7297e0e805e0cd3160cdd7e52086b93ac78ed2d 100644 (file)
@@ -5,10 +5,19 @@ After=docker.service
 
 [Service]
 EnvironmentFile=-/etc/environment
+{% if osd_scenario == 'lvm' -%}
+ExecStartPre=-/usr/bin/docker stop ceph-osd-%i
+ExecStartPre=-/usr/bin/docker rm -f ceph-osd-%i
+{% else %}
 ExecStartPre=-/usr/bin/docker stop ceph-osd-{{ ansible_hostname }}-%i
 ExecStartPre=-/usr/bin/docker rm -f ceph-osd-{{ ansible_hostname }}-%i
+{% endif -%}
 ExecStart={{ ceph_osd_docker_run_script_path }}/ceph-osd-run.sh %i
+{% if osd_scenario == 'lvm' -%}
+ExecStop=-/usr/bin/docker stop ceph-osd-%i
+{% else %}
 ExecStop=-/usr/bin/docker stop ceph-osd-{{ ansible_hostname }}-%i
+{% endif -%}
 Restart=always
 RestartSec=10s
 TimeoutStartSec=120