Project

General

Profile

Actions

Bug #6952

closed

Correctly set hostgroup after provisioning from PXE menu

Added by Dominic Cleal over 9 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Puppet integration
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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]

return Host.new, true if host.nil?

# 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
+
  1. if we were given a certname but found the Host by hostname we should update the certname
    host.certname = certname if certname.present?

EOF


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #19635: Foreman host hostgroup is changed on puppet run and fact importResolvedActions
Actions #1

Updated by Dominic Cleal over 9 years ago

  • Category set to Puppet integration
Actions #2

Updated by Ohad Levy about 8 years ago

  • Assignee set to Amir Fefer
Actions #3

Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4112 added
Actions #4

Updated by Amir Fefer over 7 years ago

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

Updated by Dominic Cleal over 7 years ago

  • translation missing: en.field_release set to 209
Actions #6

Updated by Daniel Lobato Garcia about 7 years ago

  • Target version set to 169
Actions #7

Updated by Brad Buckingham about 7 years ago

  • Target version deleted (169)
Actions #8

Updated by Daniel Lobato Garcia about 7 years ago

  • Target version set to 1.11.0
Actions #9

Updated by Dominic Cleal almost 7 years ago

  • Related to Bug #19635: Foreman host hostgroup is changed on puppet run and fact import added
Actions

Also available in: Atom PDF