Remove support for old styl resolver configuration
authorTom Hughes <tom@compton.nu>
Fri, 22 Mar 2019 19:19:07 +0000 (19:19 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 22 Mar 2019 19:19:07 +0000 (19:19 +0000)
cookbooks/networking/attributes/default.rb
cookbooks/networking/recipes/default.rb

index b126017..f7db877 100644 (file)
@@ -9,4 +9,3 @@ default[:networking][:firewall][:mangle] = true
 default[:networking][:interfaces] = {}
 default[:networking][:nameservers] = []
 default[:networking][:search] = []
-default[:networking][:resolved] = true
index 6459a7e..ae3a91d 100644 (file)
@@ -174,53 +174,22 @@ template "/etc/hosts" do
   mode 0o644
 end
 
-if node[:networking][:resolved]
-  service "systemd-resolved" do
-    action [:enable, :start]
-  end
-
-  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]"
-  end
-
-  file "/etc/resolv.conf" do
-    action :delete
-    not_if { ::File.symlink?("/etc/resolv.conf") }
-  end
-
-  link "/etc/resolv.conf" do
-    to "../run/systemd/resolve/stub-resolv.conf"
-  end
+service "systemd-resolved" do
+  action [:enable, :start]
+end
 
-  package "resolvconf" do
-    action :purge
-  end
-else
-  unless node[:networking][:nameservers].empty?
-    link "/etc/resolv.conf" do
-      action :delete
-      link_type :symbolic
-      to "/run/resolvconf/resolv.conf"
-      only_if { File.symlink?("/etc/resolv.conf") }
-    end
+directory "/etc/systemd/resolved.conf.d" do
+  owner "root"
+  group "root"
+  mode 0o755
+end
 
-    template "/etc/resolv.conf" do
-      source "resolv.conf.erb"
-      owner "root"
-      group "root"
-      mode 0o644
-    end
-  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]"
 end
 
 node.interfaces(:role => :internal) do |interface|