]> git.openstreetmap.org Git - chef.git/commitdiff
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 b1260170d8b3188f00363cfa8d9bece8e889dc7e..f7db87730f14ded5b8d719defc7f30957d654a12 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 6459a7e9dc91b840d0b07fec04980e79e10e1cb1..ae3a91d00b0e409573e93a473e74351bef021e9e 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|