Repository navigation
Conversation
Prepare missing realm credentials when an in-build host requests a finish template, after request verification and template lookup. Preserve existing OTPs and skip credential changes for previews and finish requests outside build mode. Stop rendering if realm OTP generation fails. Add regression tests.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Realm OTPs are currently only generated when rendering a provisioning template in unattended_controller. This does not work for Ubuntu Autoinstall-based hosts because they do not render this template, only userdata and finish templates.
This PR addresses this by also preparing missing realm credentials when serving a finish template for a host in build mode. This preserves the existing guard that keeps the OTP from being generated when previewing a template. Hosts without a realm and hosts with an existing OTP require no additional realm calls.
Tested on 3.19.2 with multiple autoinstall rebuilds of an existing Ubuntu 24.04 host, verifying successful IPA enrollment. Also verified that Debian 13 (regular preseed) and Rocky 10 (kickstart) installations still successfully IPA enroll, and that previewing the finish template does not generate an OTP.