subiquitymodel: validate merged cloud-config userdata_raw before reboot
This will raise noisy SchemaValidationErrors if either deprecated keys or schema errors are provided in autoinstall.user-data or in the merged userdata_raw provided to cloud-init in the installed target.
This is part of a series of PRs to support cloud-init/subiquity live-installer usability:
- Add /etc/cloud-init/clean.d/90-installer script to allow cloud-init clean to remove any installer artifacts for golden image creation
-
subiquity to read
/run/cloud-init/instance-data-sensitive.jsonfor autoinstall: config directives instead of initializingInit.read_cfg() - [This PR] Perform schema initial validation on merged userdata_raw config within the installer environment to catch cloud-init-related user misconfiguration before final target system reboot
- TBD ubuntu-desktop-installer to disable cloud-init after installed system reboot via write_files directive
- TBD Consume cloud-init status --format (json/yaml) machine readable output to report more succinct status of cloud-init
Something very strange is happening when I VM test this branch with autoinstall. Using a fairly boring autoinstall set https://gist.github.com/dbungert/a48ea4d6291daa2e2bc53fbd2056a33b, one that works fine with main branch, on this branch I see curtin throwing schema validation errors from block probing, which makes no sense whatsoever.
@blackboxsw - would you run a VM test from this branch and throw some autoinstall at it?
We determined that the 'old' non-distro version of jsonschema pip installed in the subiquity snap was incompatible with cloud-init. Dan put up https://github.com/canonical/subiquity/pull/1396 to remove that duplicate version of jsonschema and I validated that this PR works in a locally built snap based on this branch and 1396. Expectation is that we only want to merge this PR once 1396 lands.