Bug #6952
closedCorrectly set hostgroup after provisioning from PXE menu
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1127164
Description of problem:
When we provision from the standard PXE menu, we can choose which hostgroup template to install the new server from.
Version-Release number of selected component (if applicable):
6 beta
How reproducible:
always
Steps to Reproduce:
1. Create some hostgroups with associated content views and lifecycle environments
2. Build the PXE default menu from the Provisioning Templates screen
3. PXE boot a new server
4. From the boot menu, select a hostgroup boot option
Actual results:
Machine boots and installs, however once it has registered with foreman, it is not in a hostgroup
Expected results:
The newly installed machine should be in the same hostgroup that we selected in the PXE menu.
Additional info:
Candidate patch:
patch p0 -l -f << EOF /usr/share/foreman/app/models/host/managed.rb 2014-08-06 08:24:18.912311511 0000
--
++ /usr/share/foreman/app/models/host/managed.rb 2014-08-06 09:06:02.716311124 +0000@ -404,6 +404,14
@
host ||= Host.new(:name => hostname, :certname => certname) if Setting[:create_new_host_when_facts_are_uploaded]
# set hostgroup defaults if provided by a fact
+ hostgroup_fact='foreman_hostgroup'
+ if facts.keys.include?(hostgroup_fact)
+ host.hostgroup = Hostgroup.find_by_title(facts[hostgroup_fact])
+ host.set_hostgroup_defaults
+ end
+
- if we were given a certname but found the Host by hostname we should update the certname
host.certname = certname if certname.present?
EOF
Updated by The Foreman Bot almost 8 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/4112 added
Updated by Amir Fefer almost 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 9883149acbb88bd59695b92207933c074a72c427.
Updated by Dominic Cleal almost 8 years ago
- Translation missing: en.field_release set to 209
Updated by Dominic Cleal over 7 years ago
- Related to Bug #19635: Foreman host hostgroup is changed on puppet run and fact import added