Bug #7480
closedUnable to use cloned PXELinux global default template with 6.0.4
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1142160
Since "PXELinux global default" template is locked and the name is hardcoded in Foreman codebase, there is no way to use Foreman Discovery since we can't configure initial boot.
Workaround: Unlock the locked template and edit it.
- foreman-rake console
ct = ConfigTemplate.find_by_name("PXELinux global default"); ct.locked = false; ct.save!
exit
Updated by Dominic Cleal over 10 years ago
- Project changed from Foreman to Katello
- Category set to 83
- Triaged set to No
Katello should not be locking core Foreman templates: https://github.com/Katello/katello/blob/katello-2.0.0-0/db/seeds.rb#L39-L44
Updated by Lukas Zapletal over 10 years ago
Anyway I'd like to implement possibility to change hardcoded template names in Settings. I wish I remember how to change issue subject in RedMine :-(
Updated by Dominic Cleal over 10 years ago
Lukas Zapletal wrote:
Anyway I'd like to implement possibility to change hardcoded template names in Settings.
#7484 covers the subnet bit, you could file another ticket for that if you wish.
I wish I remember how to change issue subject in RedMine :-(
Click Edit, click pencil icon next to Description.
Please keep this one to fix the locking of Foreman's templates.
Updated by Stephen Benjamin over 10 years ago
Katello should not be locking core Foreman templates: https://github.com/Katello/katello/blob/katello-2.0.0-0/db/seeds.rb#L39-L44
I disagree. Foreman should be locking core templates, so that you can update them at will, but you're stuck due to precedence.
In a multi-org and multi-loc setup, having the core templates editable is just totally broken.
Updated by Stephen Benjamin over 10 years ago
Just some more background, I originally tried the permissions model, but you may have a user who should be able to change associations (requiring 'edit' permission) but not the template content.
Fire up Katello and try to imagine managing a multi-org setup with users with varying levels of permissions, with the default templates unlocked. You're opening yourself up to pure chaos when a user in Org A with no permissions to Org B are able to change a template they rely on. The core templates need to be locked for Katello to work sensibly.
I'm open to a suggestion that could fix this, and perfectly happy if you can find one in Foreman itself.
Updated by Stephen Benjamin over 10 years ago
(Although the issue at hand is fixed by not hard coding template names in the code, and the Katello locked templates issue should be done elsewhere, feel free to file an issue about it)
Updated by Eric Helms over 10 years ago
- Difficulty set to medium
- Triaged changed from No to Yes
Updated by Justin Sherrill about 10 years ago
To work around this for 2.0:
echo ConfigTemplate.find_by_name('PXELinux global default').update_attribute(:locked, false) | foreman-rake console
This allows the user to unlock the template. I believe the longer term solution is to make this not hardcoded in foreman.
Updated by Stephen Benjamin about 10 years ago
- Blocked by Feature #8477: Improve usability of config template locking/defaults added
Updated by The Foreman Bot about 10 years ago
- Status changed from New to Ready For Testing
- Target version set to 61
- Pull request https://github.com/Katello/katello/pull/4829 added
- Pull request deleted (
)
Updated by Stephen Benjamin about 10 years ago
- Assignee set to Stephen Benjamin
Updated by Anonymous about 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|268ea646bcc163956b73ae7c474f386774902550.
Updated by Eric Helms almost 10 years ago
- Translation missing: en.field_release set to 23