From d83cc610b0330824b215034855dd5151761889f7 Mon Sep 17 00:00:00 2001
From: Steve Wilkerson <sw5822@att.com>
Date: Wed, 10 Jul 2019 09:33:46 -0500
Subject: [PATCH] Disable systemd-resolved service in nameserver role

This updates the task in the disable-local-nameserver role to
include disabling the systemd-resolved service, as this causes
the entries we update in /etc/resolv.conf to not be honored as
systemd-resolved will use a different set of files for configuring
the nameservers it uses.

See: https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html

Change-Id: I68a623b7bcb32037b9eeff2d76c7f2cb317cb7d8
Signed-off-by: Steve Wilkerson <sw5822@att.com>
---
 roles/disable-local-nameserver/tasks/main.yaml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/roles/disable-local-nameserver/tasks/main.yaml b/roles/disable-local-nameserver/tasks/main.yaml
index d9f21ae6c..b847813ae 100644
--- a/roles/disable-local-nameserver/tasks/main.yaml
+++ b/roles/disable-local-nameserver/tasks/main.yaml
@@ -17,7 +17,7 @@
 # See the following for the original config:
 # * https://github.com/openstack/project-config/blob/0332c33dd134033e0620645c252f82b77e4c16f5/nodepool/elements/nodepool-base/finalise.d/89-unbound
 
-- name: Disable local nameserver
+- name: Disable local nameserver and systemd-resolved service
   when: ansible_distribution == 'Ubuntu'
   block:
     - name: update rc.local
@@ -50,3 +50,10 @@
         masked: yes
         daemon_reload: yes
         name: unbound
+    - name: stop systemd-resolved service
+      systemd:
+        state: stopped
+        enabled: no
+        masked: yes
+        daemon_reload: yes
+        name: systemd-resolved