Skip to content

Fixes #35887 - Generate realm OTP for finish-based rebuilds - #11329

Open
drkp wants to merge 1 commit into
theforeman:developfrom
drkp:fix-35887
Open

drkp wants to merge 1 commit into
theforeman:developfrom
drkp:fix-35887

Conversation

@drkp

@drkp drkp commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

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.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant