From b006b6c851edb2d187ae0dd0463d53a07f5586bd Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 10 May 2018 09:18:52 +0200 Subject: [PATCH] unbound: make sure unbound is loaded before the network is considered online --- roles/postfix/files/unbound/unbound.service.override | 2 ++ roles/postfix/tasks/unbound.yml | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 roles/postfix/files/unbound/unbound.service.override diff --git a/roles/postfix/files/unbound/unbound.service.override b/roles/postfix/files/unbound/unbound.service.override new file mode 100644 index 0000000..7c58381 --- /dev/null +++ b/roles/postfix/files/unbound/unbound.service.override @@ -0,0 +1,2 @@ +[Unit] +Before=network-online.target diff --git a/roles/postfix/tasks/unbound.yml b/roles/postfix/tasks/unbound.yml index 34fbe81..0fe643c 100644 --- a/roles/postfix/tasks/unbound.yml +++ b/roles/postfix/tasks/unbound.yml @@ -3,10 +3,20 @@ apt: name=unbound state=latest # configure - name: configure unbound + register: unbound_config copy: dest: /etc/unbound/unbound.conf.d/listen.conf src: files/unbound/listen.conf - register: unbound_config +- name: configure systemd (create dir) + file: path=/etc/systemd/system/unbound.service.d state=directory +- name: configure systemd (tweak unbound) + register: unbound_systemd + copy: + dest: /etc/systemd/system/unbound.service.d/override.conf + src: files/unbound/unbound.service.override +- name: reload systemd + when: unbound_systemd.changed + command: systemctl daemon-reload - name: restart unbound # not a handler to make sure it succeeds before we go touch system DNS when: unbound_config.changed -- 2.30.2