2017-02-08 05:00:53 +08:00
|
|
|
# {{ ansible_managed }}
|
2016-02-11 02:15:52 +08:00
|
|
|
[Unit]
|
|
|
|
Description=Ceph OSD
|
|
|
|
After=docker.service
|
|
|
|
|
|
|
|
[Service]
|
2016-03-29 16:23:31 +08:00
|
|
|
EnvironmentFile=-/etc/environment
|
2018-09-29 00:05:42 +08:00
|
|
|
{% if osd_scenario == 'lvm' -%}
|
|
|
|
ExecStartPre=-/usr/bin/docker stop ceph-osd-%i
|
|
|
|
ExecStartPre=-/usr/bin/docker rm -f ceph-osd-%i
|
|
|
|
{% else %}
|
2017-09-28 06:17:12 +08:00
|
|
|
ExecStartPre=-/usr/bin/docker stop ceph-osd-{{ ansible_hostname }}-%i
|
|
|
|
ExecStartPre=-/usr/bin/docker rm -f ceph-osd-{{ ansible_hostname }}-%i
|
2018-09-29 00:05:42 +08:00
|
|
|
{% endif -%}
|
2017-02-17 05:13:26 +08:00
|
|
|
ExecStart={{ ceph_osd_docker_run_script_path }}/ceph-osd-run.sh %i
|
2018-09-29 00:05:42 +08:00
|
|
|
{% if osd_scenario == 'lvm' -%}
|
|
|
|
ExecStop=-/usr/bin/docker stop ceph-osd-%i
|
|
|
|
{% else %}
|
2017-09-28 06:17:12 +08:00
|
|
|
ExecStop=-/usr/bin/docker stop ceph-osd-{{ ansible_hostname }}-%i
|
2018-09-29 00:05:42 +08:00
|
|
|
{% endif -%}
|
2016-02-11 02:15:52 +08:00
|
|
|
Restart=always
|
|
|
|
RestartSec=10s
|
|
|
|
TimeoutStartSec=120
|
|
|
|
TimeoutStopSec=15
|
|
|
|
|
|
|
|
[Install]
|
2016-07-09 09:38:13 +08:00
|
|
|
WantedBy=multi-user.target
|