+directory "/etc/systemd/resolved.conf.d" do
+ owner "root"
+ group "root"
+ mode 0o755
+end
+
+template "/etc/systemd/resolved.conf.d/99-chef.conf" do
+ source "resolved.conf.erb"
+ owner "root"
+ group "root"
+ mode 0o644
+ notifies :restart, "service[systemd-resolved]", :immediately
+end
+
+if node[:filesystem][:by_mountpoint][:"/etc/resolv.conf"]
+ mount "/etc/resolv.conf" do
+ action :umount
+ device node[:filesystem][:by_mountpoint][:"/etc/resolv.conf"][:devices].first