- 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"
+ only_if { ::File.exist?("/sys/class/net/wg0") }
+ end