From e9edb5a92ac513c49f13a7d6b611f47f4352b6a8 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Thu, 6 Jun 2019 15:41:35 -0400 Subject: [PATCH] podman: Add systemd dependency on network.target When using podman, the systemd unit scripts don't have a dependency on the network. So we're not sure that the network is up and running when the containers are starting. With docker this behaviour is already handled because the systemd unit scripts depend on docker service which is started after the network. Signed-off-by: Dimitri Savineau (cherry picked from commit f49090df7ef82419c69dfd7a22250a79c17de42f) --- roles/ceph-grafana/templates/grafana-server.service.j2 | 2 ++ 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-node-exporter/templates/node_exporter.service.j2 | 2 ++ roles/ceph-osd/templates/ceph-osd.service.j2 | 2 ++ roles/ceph-prometheus/templates/alertmanager.service.j2 | 2 ++ roles/ceph-prometheus/templates/prometheus.service.j2 | 2 ++ roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 | 2 ++ roles/ceph-rgw/templates/ceph-radosgw.service.j2 | 2 ++ 14 files changed, 28 insertions(+) diff --git a/roles/ceph-grafana/templates/grafana-server.service.j2 b/roles/ceph-grafana/templates/grafana-server.service.j2 index 530c9b9b4..144819b9e 100644 --- a/roles/ceph-grafana/templates/grafana-server.service.j2 +++ b/roles/ceph-grafana/templates/grafana-server.service.j2 @@ -4,6 +4,8 @@ Description=grafana-server {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] 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 9b556f391..62efd5388 100644 --- a/roles/ceph-iscsi-gw/templates/rbd-target-api.service.j2 +++ b/roles/ceph-iscsi-gw/templates/rbd-target-api.service.j2 @@ -2,6 +2,8 @@ Description=RBD Target API Service {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] 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 a08664593..af1154d35 100644 --- a/roles/ceph-iscsi-gw/templates/rbd-target-gw.service.j2 +++ b/roles/ceph-iscsi-gw/templates/rbd-target-gw.service.j2 @@ -2,6 +2,8 @@ Description=RBD Target Gateway Service {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 b/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 index 83a1aa58a..e22b7078b 100644 --- a/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 +++ b/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 @@ -2,6 +2,8 @@ Description=TCMU Runner {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-mds/templates/ceph-mds.service.j2 b/roles/ceph-mds/templates/ceph-mds.service.j2 index 5efc7b775..f35e9fea5 100644 --- a/roles/ceph-mds/templates/ceph-mds.service.j2 +++ b/roles/ceph-mds/templates/ceph-mds.service.j2 @@ -2,6 +2,8 @@ Description=Ceph MDS {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} {% set cpu_limit = ansible_processor_vcpus|int if ceph_mds_docker_cpu_limit|int > ansible_processor_vcpus|int else ceph_mds_docker_cpu_limit|int %} diff --git a/roles/ceph-mgr/templates/ceph-mgr.service.j2 b/roles/ceph-mgr/templates/ceph-mgr.service.j2 index c198c55f2..e2d52ce4b 100644 --- a/roles/ceph-mgr/templates/ceph-mgr.service.j2 +++ b/roles/ceph-mgr/templates/ceph-mgr.service.j2 @@ -2,6 +2,8 @@ Description=Ceph Manager {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index 255b355cf..b19cf85b9 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -2,6 +2,8 @@ Description=Ceph Monitor {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-nfs/templates/ceph-nfs.service.j2 b/roles/ceph-nfs/templates/ceph-nfs.service.j2 index a22b472dc..740b6b622 100644 --- a/roles/ceph-nfs/templates/ceph-nfs.service.j2 +++ b/roles/ceph-nfs/templates/ceph-nfs.service.j2 @@ -3,6 +3,8 @@ Description=NFS-Ganesha file server Documentation=http://github.com/nfs-ganesha/nfs-ganesha/wiki {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-node-exporter/templates/node_exporter.service.j2 b/roles/ceph-node-exporter/templates/node_exporter.service.j2 index 7d89a119e..b1a7fd574 100644 --- a/roles/ceph-node-exporter/templates/node_exporter.service.j2 +++ b/roles/ceph-node-exporter/templates/node_exporter.service.j2 @@ -4,6 +4,8 @@ Description=Node Exporter {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-osd/templates/ceph-osd.service.j2 b/roles/ceph-osd/templates/ceph-osd.service.j2 index ea67df29b..23a344d33 100644 --- a/roles/ceph-osd/templates/ceph-osd.service.j2 +++ b/roles/ceph-osd/templates/ceph-osd.service.j2 @@ -3,6 +3,8 @@ Description=Ceph OSD {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-prometheus/templates/alertmanager.service.j2 b/roles/ceph-prometheus/templates/alertmanager.service.j2 index 207a53e6e..e268bef90 100644 --- a/roles/ceph-prometheus/templates/alertmanager.service.j2 +++ b/roles/ceph-prometheus/templates/alertmanager.service.j2 @@ -4,6 +4,8 @@ Description=alertmanager {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-prometheus/templates/prometheus.service.j2 b/roles/ceph-prometheus/templates/prometheus.service.j2 index 0ae01940b..f0cbb9558 100644 --- a/roles/ceph-prometheus/templates/prometheus.service.j2 +++ b/roles/ceph-prometheus/templates/prometheus.service.j2 @@ -4,6 +4,8 @@ Description=prometheus {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] 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 48b94f911..23eeb02e6 100644 --- a/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 +++ b/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 @@ -2,6 +2,8 @@ Description=Ceph RBD mirror {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} [Service] diff --git a/roles/ceph-rgw/templates/ceph-radosgw.service.j2 b/roles/ceph-rgw/templates/ceph-radosgw.service.j2 index 3ba88a536..4e4730a7d 100644 --- a/roles/ceph-rgw/templates/ceph-radosgw.service.j2 +++ b/roles/ceph-rgw/templates/ceph-radosgw.service.j2 @@ -2,6 +2,8 @@ Description=Ceph RGW {% if container_binary == 'docker' %} After=docker.service +{% else %} +After=network.target {% endif %} {% set cpu_limit = ansible_processor_vcpus|int if ceph_rgw_docker_cpu_limit|int > ansible_processor_vcpus|int else ceph_rgw_docker_cpu_limit|int %}