]> git.openstreetmap.org Git - chef.git/commitdiff
Don't try and recreate bond and vlan devices
authorTom Hughes <tom@compton.nu>
Mon, 20 Mar 2023 20:52:00 +0000 (20:52 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 20 Mar 2023 20:52:00 +0000 (20:52 +0000)
cookbooks/networking/recipes/default.rb

index 7731511c0f7d19d077d8537a6d8b8b2cd0b4f5b1..47a9b8d60251fcbc240edce86fa3190632d594f0 100644 (file)
@@ -266,15 +266,8 @@ elsif node[:networking][:engine] == "systemd-networkd"
         group "root"
         mode "644"
         variables :interface => interface, :vlan => Regexp.last_match(1)
         group "root"
         mode "644"
         variables :interface => interface, :vlan => Regexp.last_match(1)
-        notifies :run, "execute[networkctl-delete-#{interface[:interface]}]"
         notifies :run, "notify_group[networkctl-reload]"
       end
         notifies :run, "notify_group[networkctl-reload]"
       end
-
-      execute "networkctl-delete-#{interface[:interface]}" do
-        action :nothing
-        command "networkctl delete #{interface[:interface]}"
-        only_if { ::File.exist?("/sys/class/net/#{interface[:interface]}") }
-      end
     elsif interface[:interface] =~ /^bond\d+$/
       template "/etc/systemd/network/10-#{interface[:interface]}.netdev" do
         source "bond.netdev.erb"
     elsif interface[:interface] =~ /^bond\d+$/
       template "/etc/systemd/network/10-#{interface[:interface]}.netdev" do
         source "bond.netdev.erb"
@@ -282,16 +275,9 @@ elsif node[:networking][:engine] == "systemd-networkd"
         group "root"
         mode "644"
         variables :interface => interface
         group "root"
         mode "644"
         variables :interface => interface
-        notifies :run, "execute[networkctl-delete-#{interface[:interface]}]"
         notifies :run, "notify_group[networkctl-reload]"
       end
 
         notifies :run, "notify_group[networkctl-reload]"
       end
 
-      execute "networkctl-delete-#{interface[:interface]}" do
-        action :nothing
-        command "networkctl delete #{interface[:interface]}"
-        only_if { ::File.exist?("/sys/class/net/#{interface[:interface]}") }
-      end
-
       interface[:bond][:slaves].each do |slave|
         file "/run/systemd/network/10-netplan-#{slave}.network" do
           action :delete
       interface[:bond][:slaves].each do |slave|
         file "/run/systemd/network/10-netplan-#{slave}.network" do
           action :delete