Red Hat Bugzilla – Bug 1124386
PXE default menu doesn't honour unattended_url setting
Last modified: 2017-02-23 16:09:51 EST
Description of problem: When usng the API to create a default PXE menu, from the server itself - the URL points at localhost Version-Release number of selected component (if applicable): How reproducible100% Steps to Reproduce: 1. Log onto the Satellite via ssh 2. Call the API to set the Default PXE menu (curl -K /opt/hoici/etc/curl-hoici.conf -XGET --data-urlencode per_page=9999 https://localhost/api/v2/config_templates/build_pxe_default) 3. cat /var/lib/tftpboot/pxelinux.cfg/default Actual results: DEFAULT menu PROMPT 0 MENU TITLE PXE Menu TIMEOUT 200 TOTALTIMEOUT 6000 ONTIMEOUT local LABEL local MENU LABEL (local) MENU DEFAULT LOCALBOOT 0 LABEL HOI-6.5.0-ci-Library - crash/IPS-Satellite6 kernel boot/RedHat-6.5-x86_64-vmlinuz append initrd=boot/RedHat-6.5-x86_64-initrd.img ks=https://localhost/unattended/template/HOI-6.5.0-ci-Library/IPS-Satellite6 ksdevice=bootif network kssendmac ipappend 2 Expected results: The kickstart should contain the hostname of the tftp capsule Additional info: Below is a posible fix copied from the host_template_helpers.rb /usr/share/foreman/app/controllers/api/v2/config_templates_controller.rb line 90 def default_template_url template, hostgroup # Get basic stuff config = URI.parse(Setting[:unattended_url]) protocol = config.scheme || 'http' port = config.port || request.port host = config.host || request.host url_for :only_path => false, :action => :template, :controller => '/unattended', :protocol => protocol, :host => host, :port => port, :id => template.name, :hostgroup => hostgroup.name End
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Created redmine issue http://projects.theforeman.org/issues/6833 from this bug
Connecting redmine issue http://projects.theforeman.org/issues/4463 from this bug
*** Bug 1144322 has been marked as a duplicate of this bug. ***
Moving to POST since upstream bug http://projects.theforeman.org/issues/4463 has been closed ------------- Anonymous Applied in changeset commit:0e3d065853992a67ab35f3d0a2747d36a766ab24.
Upstream bug assigned to stbenjam@redhat.com
please provide verification steps thanks
The steps to reproduce are in comment #1
VERIFIED: # rpm -qa | grep foreman foreman-postgresql-1.7.2.15-1.el6_6sat.noarch foreman-ovirt-1.7.2.15-1.el6_6sat.noarch ruby193-rubygem-foreman-tasks-0.6.12.3-1.el6_6sat.noarch rubygem-hammer_cli_foreman_bootdisk-0.1.2.5-1.el6_6sat.noarch ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el6_6sat.noarch ruby193-rubygem-foreman-redhat_access-0.1.0-1.el6_6sat.noarch rubygem-hammer_cli_foreman-0.1.4.7-1.el6_6sat.noarch rubygem-hammer_cli_foreman_tasks-0.0.3.3-1.el6_6sat.noarch foreman-1.7.2.15-1.el6_6sat.noarch foreman-gce-1.7.2.15-1.el6_6sat.noarch ruby193-rubygem-foreman_bootdisk-4.0.2.10-1.el6_6sat.noarch foreman-debug-1.7.2.15-1.el6_6sat.noarch rubygem-hammer_cli_foreman_discovery-0.0.1.4-1.el6_6sat.noarch foreman-selinux-1.7.2.13-1.el6_6sat.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-proxy-1.0-2.noarch foreman-compute-1.7.2.15-1.el6_6sat.noarch ruby193-rubygem-foreman_docker-1.2.0.7-1.el6_6sat.noarch ruby193-rubygem-foreman_discovery-2.0.0.9-1.el6_6sat.noarch foreman-libvirt-1.7.2.15-1.el6_6sat.noarch foreman-proxy-1.7.2.4-1.el6_6sat.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-client-1.0-1.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch ruby193-rubygem-foreman_hooks-0.3.7-2.el6_6sat.noarch foreman-vmware-1.7.2.15-1.el6_6sat.noarch # curl -k -u admin -XGET https://qe-sat6-rhel66.usersys.redhat.com/api/v2/config_templates/build_pxe_default Enter host password for user 'admin': PXE Default file has been deployed to all Smart Proxies cat /var/lib/tftpboot/pxelinux.cfg/default DEFAULT menu PROMPT 0 MENU TITLE PXE Menu TIMEOUT 200 TOTALTIMEOUT 6000 ONTIMEOUT local LABEL local MENU LABEL (local) MENU DEFAULT LOCALBOOT 0
Sorry, but the used QA test is not incorrect to verify the expected behaviour: - It doesn't use localhost in the curl GET command - There is no hostgroup menu entry to verify that the unattended_url is really used
Reopening as this bug needs to be verified properly, as per the initial bug description.
[root@xxxx pxelinux.cfg]# curl -k -u admin -XGET --data-urlencode per_page=9999 https://localhost/api/v2/config_templates/build_pxe_default Enter host password for user 'admin': PXE Default file has been deployed to all Smart Proxies[root@dhcp201-174 pxelinux.cfg]# ls default [root@dhcp201-174 pxelinux.cfg]# cat default DEFAULT menu PROMPT 0 MENU TITLE PXE Menu TIMEOUT 200 TOTALTIMEOUT 6000 ONTIMEOUT local LABEL local MENU LABEL (local) MENU DEFAULT LOCALBOOT 0 LABEL Satellite Kickstart Default - rhel66_grp kernel boot/RedHat-6.6-x86_64-vmlinuz append initrd=boot/RedHat-6.6-x86_64-initrd.img ks=https://http://dhcpxxx-yy.englabit.pune.redhat.com/unattended/template/Satellite%20Kickstart%20Default/rhel66_grp ksdevice=bootif network kssendmac But I feel this bug better be re-tested after bug https://bugzilla.redhat.com/show_bug.cgi?id=1136002 is fixed.
[root@xyz pxelinux.cfg]# curl -k -u admin -XGET --data-urlencode per_page=9999 https://localhost/api/v2/config_templates/build_pxe_default Enter host password for user 'admin': PXE Default file has been deployed to all Smart Proxies [root@xyz pxelinux.cfg]# ls default [root@xyz pxelinux.cfg]# cat default DEFAULT menu PROMPT 0 MENU TITLE PXE Menu TIMEOUT 200 TOTALTIMEOUT 6000 ONTIMEOUT local LABEL local MENU LABEL (local) MENU DEFAULT LOCALBOOT 0 LABEL Satellite Kickstart Default - rhel66_grp kernel boot/RedHat-6.6-x86_64-vmlinuz append initrd=boot/RedHat-6.6-x86_64-initrd.img ks=http://xyzabc.englabit1.pune1.redhat.com:80/unattended/template/Satellite%20Kickstart%20Default/rhel66_grp ksdevice=bootif network kssendmac VERIFIED with Satellite-6.1.0-RHEL-7-20150429.2/satellite-6.1-GA-SNAP2
This bug is slated to be released with Satellite 6.1.
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/RHSA-2015:1592