System Management
netplan apply fails with a parse error after an administrator edits /etc/netplan/01-netcfg.yaml. The keys and values are correct. What is a likely cause?
Show the answer
Correct answerB. Some lines are indented with tab characters
AWhy not this: YAML accepts any consistent number of spaces per level, so two spaces is valid.
BWhy this is right: YAML does not allow tabs for indentation, so a tab causes a parse error.
CWhy not this: Netplan reads *.yaml files in /etc/netplan; .yaml is the expected extension.
DWhy not this: YAML supports comments that begin with #, so they do not cause a parse error.
YAML forbids tabs for indentation, so Netplan files must use spaces, and a tab causes a parse error. The idea that tabs are accepted as equivalent to spaces is a common misconception carried over from other configuration formats.