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
|
2016-02-11 02:15:52 +08:00
|
|
|
ExecStartPre=-/usr/bin/docker stop {{ ansible_hostname }}-osd-dev%i
|
|
|
|
ExecStartPre=-/usr/bin/docker rm {{ ansible_hostname }}-osd-dev%i
|
|
|
|
ExecStart=/usr/bin/docker run --rm --net=host --pid=host\
|
2016-03-29 16:23:31 +08:00
|
|
|
{% if not osd_containerized_deployment_with_kv -%}
|
2016-02-11 02:15:52 +08:00
|
|
|
-v /var/lib/ceph:/var/lib/ceph \
|
|
|
|
-v /etc/ceph:/etc/ceph \
|
2016-03-29 16:23:31 +08:00
|
|
|
{% else -%}
|
|
|
|
-e KV_TYPE={{kv_type}} \
|
2016-03-30 18:22:32 +08:00
|
|
|
-e KV_IP={{kv_endpoint}} \
|
2016-03-29 16:23:31 +08:00
|
|
|
{% endif -%}
|
2016-02-11 02:15:52 +08:00
|
|
|
-v /dev:/dev \
|
|
|
|
--privileged \
|
|
|
|
-e CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE \
|
|
|
|
-e OSD_DEVICE=/dev/%i \
|
|
|
|
--name={{ ansible_hostname }}-osd-dev%i \
|
|
|
|
{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}
|
|
|
|
ExecStop=-/usr/bin/docker stop {{ ansible_hostname }}-osd-dev%i
|
|
|
|
Restart=always
|
|
|
|
RestartSec=10s
|
|
|
|
TimeoutStartSec=120
|
|
|
|
TimeoutStopSec=15
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|