Bug 1264916
Summary: | Missing variable to include Sat 6 Hostname in PXE Menus | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Peter Vreman <peter.vreman> | ||||
Component: | TFTP | Assignee: | Marek Hulan <mhulan> | ||||
Status: | CLOSED ERRATA | QA Contact: | Sachin Ghai <sghai> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 6.1.2 | CC: | bbuckingham, omaciel, pcfe, peter.vreman, sghai, xdmoon | ||||
Target Milestone: | Unspecified | Keywords: | Triaged | ||||
Target Release: | Unused | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
URL: | http://projects.theforeman.org/issues/14232 | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2016-07-27 11:20:03 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1122832 | ||||||
Attachments: |
|
Description
Peter Vreman
2015-09-21 12:55:58 UTC
You can use following DEFAULT menu PROMPT 0 MENU TITLE PXE Menu - <%= foreman_url.sub('/unattended/built', '') %> You can even omit the .sub(...) part if you don't mind that url would include unattended path. The foreman_url determines the hostname by "Unattended URL" setting (Administer -> Settings -> Provision). Would this be enough or do you want to add new helper that would remove the path from url? Actually the snippet can be even a bit simpler using chomp instead of sub <%= foreman_url.chomp('/unattended/built') %> When it works the provided solution of using foreman_url is enough. But sadly it is not alled by the Safemode jail: Using <%= foreman_url.sub('/unattended/built', '') %>: [crash] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"organization_id\":3}" -XGET https://localhost/api/config_templates/build_pxe_default failed to process template: undefined method 'sub' for NilClass::Jail (NilClass) Using <%= foreman_url.chomp('/unattended/built') %>: [crash] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"organization_id\":3}" -XGET https://localhost/api/config_templates/build_pxe_default failed to process template: Safemode doesn't allow to access 'foreman_url' on #<Safemode::ScopeObject> Sorry I've tested with slightly newer version version of satellite, this will be possible with Satellite 6.2. The foreman_url function must be available though, since we use it in default PXELinux template to get url for kickstart file. It's called slightly differently, could you please try using <%= foreman_url('provision') %> instead? I didn't realize that build_pxe_default might have different rendering context, I'll verify if that's the case Created redmine issue http://projects.theforeman.org/issues/14232 from this bug Ok I was able to reproduce. There might be a workaround to use default_template_url but it's getting really hacky. I'll change it so that it will allow using foreman_url even when building pxe default template along with other useful helpers like snippet. Upstream bug component is TFTP Moving to POST since upstream bug http://projects.theforeman.org/issues/14232 has been closed ------------- Marek Hulán Applied in changeset commit:e4ed4a0db4d60f68183b5ef3bff13e136af684e6. Verified with sat62 GA snap10.1 Now you can set the foreman_fqdn in PXE menus with variable: <%= foreman_server_fqdn %> Please see the attached screenshot where PXE Men Title rendered with foreman server name. Created attachment 1155221 [details]
foreman fqdn varibale set and it correctly rendered as PXE menu title.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1501 |