Bug #5450
closedKickstart Templates Don't Render FreeIPA Snippet correctly
Description
In order to have backward compatibility with earlier versions of Foreman, the template checks if `@host.respond_to? :otp`, but this doesn't work in safe mode, even after adding it to the Jail.
Updated by Stephen Benjamin over 10 years ago
@host.methods doesn't actually return all the available methods in the safe mode jail, which is why respond_to? doesn't work as expected. Anyway, we're stuck with identifying a Realm-capable foreman version using only the features 1.4. This simply will cause the template not to render on < 1.5:
<% if @host.otp && @host.realm && @host.realm.realm_type == "FreeIPA" && os_major <= 6 -%>
The only way I see is to add something to 1.5 that lets us know we can do realms, but that still works on 1.4...so, as far as I can see, that means abusing an existing hash.
What about adding this to Host::Managed#info?
param["realm"] = realm.name if realm
Then:
<% if @host.params["realm"] && @host.otp && @host.realm.realm_type == "FreeIPA" && os_major <= 6 -%>
Updated by Stephen Benjamin over 10 years ago
- Priority changed from Normal to High
Ah sorry, should be this, but same idea:
<% if @host.info["parameters"]["realm"] && @host.otp && @host.realm.realm_type == "FreeIPA" && os_major <= 6 -%>
But anyway, as it stands in the RHEL KS template, the freeipa_snippet will never be reached because of the failing respond_to?
Updated by Stephen Benjamin over 10 years ago
- Status changed from New to Ready For Testing
Updated by Dominic Cleal over 10 years ago
- Assignee set to Stephen Benjamin
- Target version set to 1.8.3
- Translation missing: en.field_release set to 4
Updated by Stephen Benjamin over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 77d9d699b32e735e4b70195e978de108a992d3f5.