hypriot / flash

Command line script to flash SD card images of any kind
MIT License
1k stars 176 forks source link

Check for #cloud-config comment in first line #178

Closed StefanScherer closed 4 years ago

StefanScherer commented 4 years ago

On macOS we already validate the user-data yaml file, but this does not include a check for the #cloud-config comment in the first line.

According to https://cloudinit.readthedocs.io/en/latest/topics/faq.html#how-can-i-debug-my-user-data it is one of the two top most problems. In my experience it IS the top most problem and to be honest I do not understand why this cannot be fixed in cloud-init 😅

Two of the most common issues with user data, that also happens to be cloud-config is:

  1. Incorrectly formatted YAML
  2. First line does not contain #cloud-config

Helps #177 to find problems before users run into boot problems.