Inconsistent indentation with YAML

While trying to set up my Ubuntu Server, I've stumbled upon this error when typing Netplan Generate

Invalid YAML: inconsistent indentation:

But it just shows

                  ^             

I have no Idea where the error is.

My Code is:

network:
  ethernets:
    addresses: [192.168.136.1/24]
    gateway4: 192.168.136.1
    nameservers: 
      addresses: [1.1.1.1, 1.0.0.1]
      search: []
  version: 2
  wifis:
    wlp2s2:
      dhcp4: yes
      access-points:
        'SSID'
          password: 'password'

Please Note that: The ethernets part was there when I opened it for the first time, so I only configured the wifis part.

I've left the SSID and the password away for obvious reasons.

Can anyone help?


  1. The first comment made two points:

    Missing something ...

  2. The second comment corroborated something in the first, supplied a tool to validate the YAML against, and pointed to a specific line:

    YAML Validation

  3. Using the YAML validator, invalid YAML was confirmed:

    Missing a colon

  4. Adding a colon resolves the issue:

    One-Two Punch