]> git.openstreetmap.org Git - chef.git/commitdiff
Drop support for Ubuntu 18.04
authorTom Hughes <tom@compton.nu>
Mon, 20 Mar 2023 17:19:58 +0000 (17:19 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 20 Mar 2023 17:19:58 +0000 (17:19 +0000)
cookbooks/networking/recipes/default.rb
cookbooks/networking/templates/default/wireguard.netdev.erb
cookbooks/python/recipes/default.rb

index a7006d436e0897914a2ecb649975ef76e607b357..4d3974b961c0fd43ea77252603f0abed86ef5024 100644 (file)
@@ -323,35 +323,19 @@ if node[:networking][:wireguard][:enabled]
     mode "644"
   end
 
-  if node[:lsb][:release].to_f < 20.04
-    execute "ip-link-delete-wg0" do
-      action :nothing
-      command "ip link delete wg0"
-      subscribes :run, "template[/etc/systemd/network/wireguard.netdev]"
-      only_if { ::File.exist?("/sys/class/net/wg0") }
-    end
-
-    service "systemd-networkd" do
-      action :nothing
-      subscribes :restart, "template[/etc/systemd/network/wireguard.netdev]"
-      subscribes :restart, "template[/etc/systemd/network/wireguard.network]"
-      not_if { kitchen? }
-    end
-  else
-    execute "networkctl-delete-wg0" do
-      action :nothing
-      command "networkctl delete wg0"
-      subscribes :run, "template[/etc/systemd/network/wireguard.netdev]"
-      only_if { ::File.exist?("/sys/class/net/wg0") }
-    end
+  execute "networkctl-delete-wg0" do
+    action :nothing
+    command "networkctl delete wg0"
+    subscribes :run, "template[/etc/systemd/network/wireguard.netdev]"
+    only_if { ::File.exist?("/sys/class/net/wg0") }
+  end
 
-    execute "networkctl-reload" do
-      action :nothing
-      command "networkctl reload"
-      subscribes :run, "template[/etc/systemd/network/wireguard.netdev]"
-      subscribes :run, "template[/etc/systemd/network/wireguard.network]"
-      not_if { kitchen? }
-    end
+  execute "networkctl-reload" do
+    action :nothing
+    command "networkctl reload"
+    subscribes :run, "template[/etc/systemd/network/wireguard.netdev]"
+    subscribes :run, "template[/etc/systemd/network/wireguard.network]"
+    not_if { kitchen? }
   end
 end
 
index 248bde252660c11b56407260aba5eda7e6972663..979e68eee2e06cff62bd3b97a256a297edbe6a06 100644 (file)
@@ -3,21 +3,13 @@ Name=wg0
 Kind=wireguard
 
 [WireGuard]
-<% if node[:lsb][:release].to_f < 20.04 -%>
-PrivateKey=<%= IO.read("/var/lib/systemd/wireguard/private.key").chomp %>
-<% else -%>
 PrivateKeyFile=/var/lib/systemd/wireguard/private.key
-<% end -%>
 ListenPort=51820
 <% node[:networking][:wireguard][:peers].sort_by { |p| p[:public_key] }.each do |peer| -%>
 
 [WireGuardPeer]
 PublicKey=<%= peer[:public_key] %>
-<% if node[:lsb][:release].to_f < 20.04 -%>
-PresharedKey=<%= IO.read("/var/lib/systemd/wireguard/preshared.key").chomp %>
-<% else -%>
 PresharedKeyFile=/var/lib/systemd/wireguard/preshared.key
-<% end -%>
 AllowedIPs=<%= Array(peer[:allowed_ips]).sort.join(",") %>
 <% if peer[:endpoint] -%>
 Endpoint=<%= peer[:endpoint] %>
index 00f763bac9a0b7a5c084ac3f98e15900f4e0b908..8abefc794a78781ffd572b93947a43c611265d08 100644 (file)
 # limitations under the License.
 #
 
-if node[:lsb][:release].to_f < 20.04
-  package "python"
-  package "python-pip"
-end
-
 package "python3"
 package "python3-pip"