Netplan - Ethernet when available, wifi when not. Reconnect if needed

Solution 1:

Try...

An optional device is not required for booting. Normally, networkd will wait some time for device to become configured before proceeding with booting. However, if a device is marked as optional, networkd will not wait for it. This is only supported by networkd, and the default is false.

Source: https://netplan.io/reference

network:
  version: 2
  renderer: networkd
  ethernets:
    enp2s0:
      dhcp4: yes
      dhcp4-overrides:    # possibly not functional yet
        route-metric: 100 # possibly not functional yet
      optional: true
  wifis:
    wlx0013xxx:
      access-points:
        "the-network":
          password: "the-password"
      dhcp4: true
      dhcp4-overrides:    # possibly not functional yet
        route-metric: 200 # possibly not functional yet