From eff159b61b6399474d68340109f5a5096f879430 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 30 Apr 2024 13:05:50 -0400 Subject: [PATCH] Enable and start systemd-resolved sooner We must start the service to populate the files in /run/systemd/resolve/, before we can create the /etc/resolv.conf. --- tasks/main.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index d12ab60..39e0a34 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,6 +4,15 @@ name: - systemd-resolved +- name: Enable and start systemd-resolved + ansible.builtin.service: + enabled: true + name: systemd-resolved.service + # We must start the service to populate the files in + # /run/systemd/resolve/, which we need when we create a symlink + # below. + state: started + - name: Ensure resolvconf is not installed ansible.builtin.package: name: @@ -21,8 +30,3 @@ path: /etc/resolv.conf src: /run/systemd/resolve/stub-resolv.conf state: link - -- name: Enable systemd-resolved - ansible.builtin.service: - enabled: true - name: systemd-resolved.service