From f830046541ead8446f6519d3cbf833080ce161b9 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Thu, 18 Jan 2018 14:48:41 +0100 Subject: [PATCH] unfuck systemd startup issues --- roles/nginx/tasks/main.yml | 6 ++++++ roles/respondd/templates/respondd.service.j2 | 2 +- roles/yanic/files/yanic.service | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index e422e18..740e9c6 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -32,5 +32,11 @@ when: nginx_ssl == True notify: Restart nginx +- name: Ensure network and dns are available before nginx + lineinfile: + dest: /lib/systemd/system/nginx.service + line: "After=network-online.target nss-lookup.target" + regexp: "^After=" + - name: Start nginx service: name=nginx state=started enabled=yes diff --git a/roles/respondd/templates/respondd.service.j2 b/roles/respondd/templates/respondd.service.j2 index d7a1e5e..2519c23 100644 --- a/roles/respondd/templates/respondd.service.j2 +++ b/roles/respondd/templates/respondd.service.j2 @@ -2,7 +2,7 @@ [Unit] Description=respondd -After=network.target +After=network-online.target [Service] ExecStart=/opt/{{ site_code }}/respondd-announce/respondd.py -b {{ batman_interface }} -i {{ main_bridge }} -i vpn-{{ site_code }} -d /opt/{{ site_code }}/respondd-announce/ diff --git a/roles/yanic/files/yanic.service b/roles/yanic/files/yanic.service index a0d55fc..40a2ccf 100644 --- a/roles/yanic/files/yanic.service +++ b/roles/yanic/files/yanic.service @@ -1,6 +1,6 @@ [Unit] Description=yanic -After=network.target +After=network-online.target [Service] Type=simple