It looks like at least some of this changed between Bionic and Cosmic - here with a netplan 0.39:
root@netplan:~# netplan apply Error in network definition /etc/netplan/50-cloud-init.yaml line 5 column 0: unknown key xxnetwork root@netplan:~# echo $? 78
It looks like at least some of this changed between Bionic and Cosmic - here with a netplan 0.39:
root@netplan:~# netplan apply 50-cloud- init.yaml line 5 column 0: unknown key xxnetwork
Error in network definition /etc/netplan/
root@netplan:~# echo $?
78