ceph-mgr.service.j2 1.43 KB
Newer Older
1
2
[Unit]
Description=Ceph Manager
3
{% if container_binary == 'docker' %}
4
After=docker.service
5
Requires=docker.service
6
7
8
{% else %}
After=network.target
{% endif %}
9
10
11

[Service]
EnvironmentFile=-/etc/environment
12
13
14
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mgr-{{ ansible_hostname }}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
15
  --memory={{ ceph_mgr_docker_memory_limit }} \
16
  {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
17
  --cpus={{ ceph_mgr_docker_cpu_limit }} \
18
19
20
21
  {% else -%}
  --cpu-quota={{ ceph_mgr_docker_cpu_limit * 100000 }} \
  {% endif -%}
  {% if not containerized_deployment_with_kv -%}
22
  -v /var/lib/ceph:/var/lib/ceph:z,rshared \
Sébastien Han's avatar
Sébastien Han committed
23
  -v /etc/ceph:/etc/ceph:z \
Sébastien Han's avatar
Sébastien Han committed
24
  -v /var/run/ceph:/var/run/ceph:z \
25
26
27
28
29
30
  {% else -%}
  -e KV_TYPE={{kv_type}} \
  -e KV_IP={{kv_endpoint}} \
  -e KV_PORT={{kv_port}} \
  {% endif -%}
  -v /etc/localtime:/etc/localtime:ro \
31
  -e CLUSTER={{ cluster }} \
32
33
34
35
  -e CEPH_DAEMON=MGR \
  {{ ceph_mgr_docker_extra_env }} \
  --name=ceph-mgr-{{ ansible_hostname }} \
  {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
36
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }}
37
38
39
40
41
42
43
Restart=always
RestartSec=10s
TimeoutStartSec=120
TimeoutStopSec=15

[Install]
WantedBy=multi-user.target