Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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?

>Solution :

  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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading