Project

General

Profile

Actions

Bug #37433

open

Cloudinit default generates invalid yaml output

Added by Joniel Pasqualetto 11 days ago. Updated 11 days ago.

Status:
Ready For Testing
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
trivial
Triaged:
No
Fixed in Releases:
Found in Releases:

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:

https://github.com/theforeman/foreman/blob/develop/app/views/unattended/provisioning_templates/snippet/redhat_register.erb#L99

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

Actions #1

Updated by The Foreman Bot 11 days ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/10153 added
Actions

Also available in: Atom PDF