Here is a working YAML file for connection to local WPA2 wifi Network.
Create this file in /etc/netplan.
network: version: 2 wifis: wlan0: renderer: NetworkManager match: {} dhcp4: true access-points: "open network": {}
An assumption is that there is only one wifi device in the system. If this is not true, replace match: {} with something more specific.
In YAML, indentation matters, so ensure that this is maintained in the YAML config file.
Run the following to enable the change:
netplan generate; netplan apply
and things should work.
You can file bugs on Launchpad.