From a089e1ec23c55430d58ad2f41d3c2a6149510434 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Thu, 7 Mar 2019 12:31:39 -0500 Subject: [PATCH] systemd/service: Set docker.service conditionally We don't need to set After=docker.service when the container_binary variable isn't set to docker. It doesn't break anything currently but it could be confusing when using podman. Signed-off-by: Dimitri Savineau --- roles/ceph-iscsi-gw/templates/rbd-target-api.service.j2 | 2 ++ roles/ceph-iscsi-gw/templates/rbd-target-gw.service.j2 | 2 ++ roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 | 2 ++ roles/ceph-mds/templates/ceph-mds.service.j2 | 2 ++ roles/ceph-mgr/templates/ceph-mgr.service.j2 | 2 ++ roles/ceph-mon/templates/ceph-mon.service.j2 | 2 ++ roles/ceph-nfs/templates/ceph-nfs.service.j2 | 2 ++ roles/ceph-osd/templates/ceph-osd.service.j2 | 2 ++ roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 | 2 ++ roles/ceph-rgw/templates/ceph-radosgw.service.j2 | 2 ++ 10 files changed, 20 insertions(+) diff --git a/roles/ceph-iscsi-gw/templates/rbd-target-api.service.j2 b/roles/ceph-iscsi-gw/templates/rbd-target-api.service.j2 index a47493d84..9b556f391 100644 --- a/roles/ceph-iscsi-gw/templates/rbd-target-api.service.j2 +++ b/roles/ceph-iscsi-gw/templates/rbd-target-api.service.j2 @@ -1,6 +1,8 @@ [Unit] Description=RBD Target API Service +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-iscsi-gw/templates/rbd-target-gw.service.j2 b/roles/ceph-iscsi-gw/templates/rbd-target-gw.service.j2 index e01317ab5..a08664593 100644 --- a/roles/ceph-iscsi-gw/templates/rbd-target-gw.service.j2 +++ b/roles/ceph-iscsi-gw/templates/rbd-target-gw.service.j2 @@ -1,6 +1,8 @@ [Unit] Description=RBD Target Gateway Service +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 b/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 index 0963e0e01..83a1aa58a 100644 --- a/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 +++ b/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 @@ -1,6 +1,8 @@ [Unit] Description=TCMU Runner +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-mds/templates/ceph-mds.service.j2 b/roles/ceph-mds/templates/ceph-mds.service.j2 index eeeebf5a5..2349e2919 100644 --- a/roles/ceph-mds/templates/ceph-mds.service.j2 +++ b/roles/ceph-mds/templates/ceph-mds.service.j2 @@ -1,6 +1,8 @@ [Unit] Description=Ceph MDS +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-mgr/templates/ceph-mgr.service.j2 b/roles/ceph-mgr/templates/ceph-mgr.service.j2 index a8d4e1b3b..c198c55f2 100644 --- a/roles/ceph-mgr/templates/ceph-mgr.service.j2 +++ b/roles/ceph-mgr/templates/ceph-mgr.service.j2 @@ -1,6 +1,8 @@ [Unit] Description=Ceph Manager +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index 7a4d5990d..255b355cf 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -1,6 +1,8 @@ [Unit] Description=Ceph Monitor +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-nfs/templates/ceph-nfs.service.j2 b/roles/ceph-nfs/templates/ceph-nfs.service.j2 index e215eb92f..a22b472dc 100644 --- a/roles/ceph-nfs/templates/ceph-nfs.service.j2 +++ b/roles/ceph-nfs/templates/ceph-nfs.service.j2 @@ -1,7 +1,9 @@ [Unit] Description=NFS-Ganesha file server Documentation=http://github.com/nfs-ganesha/nfs-ganesha/wiki +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-osd/templates/ceph-osd.service.j2 b/roles/ceph-osd/templates/ceph-osd.service.j2 index fc46baf11..31e117c68 100644 --- a/roles/ceph-osd/templates/ceph-osd.service.j2 +++ b/roles/ceph-osd/templates/ceph-osd.service.j2 @@ -1,7 +1,9 @@ # {{ ansible_managed }} [Unit] Description=Ceph OSD +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 b/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 index a0a90bb6a..48b94f911 100644 --- a/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 +++ b/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 @@ -1,6 +1,8 @@ [Unit] Description=Ceph RBD mirror +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=-/etc/environment diff --git a/roles/ceph-rgw/templates/ceph-radosgw.service.j2 b/roles/ceph-rgw/templates/ceph-radosgw.service.j2 index 1af65ba8b..d25cf3e6b 100644 --- a/roles/ceph-rgw/templates/ceph-radosgw.service.j2 +++ b/roles/ceph-rgw/templates/ceph-radosgw.service.j2 @@ -1,6 +1,8 @@ [Unit] Description=Ceph RGW +{% if container_binary == 'docker' %} After=docker.service +{% endif %} [Service] EnvironmentFile=/var/lib/ceph/radosgw/ceph-%i/EnvironmentFile