From bd52ad6dd710f4f16bbfa9b7e1ed084d03e48e9d Mon Sep 17 00:00:00 2001 From: Tobias Hachmer Date: Mon, 5 Feb 2018 17:37:52 +0100 Subject: [PATCH] Role server-basic: fix networking.service from ifupdown2 - some interfaces come up too late --- roles/server-basic/tasks/main.yml | 18 ++++++++++++++++++ .../templates/networking_service_overrides.j2 | 10 ++++++++++ 2 files changed, 28 insertions(+) create mode 100644 roles/server-basic/templates/networking_service_overrides.j2 diff --git a/roles/server-basic/tasks/main.yml b/roles/server-basic/tasks/main.yml index 02e5227..afdbb45 100644 --- a/roles/server-basic/tasks/main.yml +++ b/roles/server-basic/tasks/main.yml @@ -67,3 +67,21 @@ mode: 0644 owner: root group: root + +- name: create systemd override dir for networking.service + file: + path: /etc/systemd/system/networking.service.d + state: directory + owner: root + group: root + mode: 0755 + +- name: configure systemd unit overrides + template: + src: networking_service_overrides.j2 + dest: /etc/systemd/system/networking.service.d/override.conf + owner: root + group: root + mode: 0644 + notify: + - reload systemd diff --git a/roles/server-basic/templates/networking_service_overrides.j2 b/roles/server-basic/templates/networking_service_overrides.j2 new file mode 100644 index 0000000..f054df1 --- /dev/null +++ b/roles/server-basic/templates/networking_service_overrides.j2 @@ -0,0 +1,10 @@ +[Unit] +DefaultDependencies=no +Wants=network.target +After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service systemd-modules-load.service +Before=network.target shutdown.target network-online.target +Conflicts=shutdown.target + +[Install] +WantedBy=multi-user.target +WantedBy=network-online.target