Bug #37433
closedCloudinit default generates invalid yaml output
Description
Description of problem:
Starting on Satellite 6.15, the template cloudinit default generates an invalid yaml output.
This breaks the usage of cloud-init for provisioning.
This used to work until Satellite 6.14
How reproducible:
Always
Is this issue a regression from an earlier version:
Yes
Steps to Reproduce:
1. Create a host and assign an activation key to it (without the activation key, the broken part of the template is not processed)
2. Render the cloudinit default template for that host
3. Check the rendered template and you'll that's not a valid yaml. Indentation is wrong.
Actual behavior:
Bad indentation on the rendered output, resulting in invalid yaml, which cloud-init can't process properly.
Expected behavior:
Valid yaml output, so cloud-init will finish the provisioning properly
Business Impact / Additional info:
Problem comes from the snippet redhat_register. Until 6.14, all the code was inside the snippet itself. On 6.15, we introduced a new snippet (which is called inside redhat_register) to configure subscription-manager. That snippet is not being called with an indentation option and the result is the bad indentation.
Here's the line:
Adding a simple indent(2) when calling the new snippet subscription_manager_setup is enough to fix the problem.
Red Hat issue -> https://issues.redhat.com/browse/SAT-25042