Project

General

Profile

Actions

Bug #5450

closed

Kickstart Templates Don't Render FreeIPA Snippet correctly

Added by Stephen Benjamin almost 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
High
Category:
Templates
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.

Actions #2

Updated by Stephen Benjamin almost 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 -%>
Actions #3

Updated by Stephen Benjamin almost 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?

Actions #5

Updated by Dominic Cleal almost 10 years ago

  • Assignee set to Stephen Benjamin
  • Target version set to 1.8.3
  • translation missing: en.field_release set to 4
Actions #6

Updated by Stephen Benjamin almost 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF