ceph-ansible/roles/ceph-osd/templates/ceph-osd.service.j2

28 lines
844 B
Plaintext
Raw Normal View History

# {{ ansible_managed }}
[Unit]
Description=Ceph OSD
After=docker.service
[Service]
EnvironmentFile=-/etc/environment
{% if osd_scenario == 'lvm' -%}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-osd-%i
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-osd-%i
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-osd-{{ ansible_hostname }}-%i
ExecStartPre=-/usr/bin/{{ container_binary }} 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/{{ container_binary }} stop ceph-osd-%i
{% else %}
ExecStop=-/usr/bin/{{ container_binary }} stop ceph-osd-{{ ansible_hostname }}-%i
{% endif -%}
Restart=always
RestartSec=10s
TimeoutStartSec=120
TimeoutStopSec=15
[Install]
WantedBy=multi-user.target