LP: #2020397 - preseed overrides for custom image dependency validation
Custom images without package manager (chiselled/locked-down)
fail the (curtin) late_commands for dependency validation as
of MAAS 3.2 (but worked before).
These validations are an improvement for MAAS robustness, but
unfortunately are a regression for some users/images, and may
not allow them to upgrade MAAS (deployments now fail).
This is a corner case for a few expert users with deployments
that are significantly reliant on MAAS, so a contained change
would do.
MAAS could allow them to use the curtin_userdata preseed to
override the default commands for validations with commands
that work in their images. (Note: validations still needed!)
Tests:
=====
Steps: download centos70 image, upload as custom, deploy.
(do not set base_image to centos on purpose.)
No overrides (default):
start: cmd-install/stage-late/98-validate-custom-image-has-cloud-init: running 'curtin in-target -- bash -c dpkg-query -s cloud-init || (echo "cloud-init not detected, MAAS will not be able to configure this machine properly" && exit 1)'
...
bash: dpkg-query: command not found
cloud-init not detected, MAAS will not be able to configure this machine properly
...
finish: cmd-install/stage-late: FAIL: executing late commands
Override 1 out of 2 checks:
late_commands:
98-validate-custom-image-has-cloud-init: ['ls', '/usr/bin/cloud-init']
start: cmd-install/stage-late/98-validate-custom-image-has-cloud-init: running 'ls /usr/bin/cloud-init'
/usr/bin/cloud-init
finish: cmd-install/stage-late/98-validate-custom-image-has-cloud-init: SUCCESS: running 'ls /usr/bin/cloud-init'
start: cmd-install/stage-late/99-validate-custom-image-has-netplan.io: running 'curtin in-target -- bash -c dpkg-query -s netplan.io || (echo "netplan.io not detected, MAAS will not be able to configure this machine properly" && exit 1)'
...
bash: dpkg-query: command not found
netplan.io not detected, MAAS will not be able to configure this machine properly
...
finish: cmd-install/stage-late: FAIL: executing late commands
Override 2 out of 2 checks:
late_commands:
98-validate-custom-image-has-cloud-init: ['ls', '/usr/bin/cloud-init']
99-validate-custom-image-has-netplan.io: ['echo', 'this custom image does not use netplan']
start: cmd-install/stage-late/98-validate-custom-image-has-cloud-init: running 'ls /usr/bin/cloud-init'
/usr/bin/cloud-init
finish: cmd-install/stage-late/98-validate-custom-image-has-cloud-init: SUCCESS: running 'ls /usr/bin/cloud-init'
start: cmd-install/stage-late/99-validate-custom-image-has-netplan.io: running 'echo this custom image does not use netplan'
this custom image does not use netplan
finish: cmd-install/stage-late/99-validate-custom-image-has-netplan.io: SUCCESS: running 'echo this custom image does not use netplan'
...
finish: cmd-install/stage-late: SUCCESS: executing late commands
Signed-off-by: Mauricio Faria de Oliveira <email address hidden>