Project

General

Profile

Actions

Feature #3371

closed

Customize the data used to select the hostname for a discovered host

Added by Greg Sutcliffe about 11 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

From the mailinglist:

On 18 October 2013 16:49, <> wrote:
Hi,
Will it be possible to change hard-coded "macaddress_eth0" fact name that define default name of the discovered host to be custom name that is set in the Foreman settings?
It can be by default "macaddress_eth0", but I use discovery_init.sh script to setup some additional facts before they are imported into Foreman, and I want to use one of my facts to be a new default hostname as it allow me to easier identify discovered hosts.
Also some of my hosts do not have eth0 so hard-coded "macaddress_eth0" basically doesn't work very well with some machines.
At the moment hard-coded fact name is in the file app/models/host/discovered.rb.

I experimented with using "macaddress" instead, but the TCL image creates a "dummy" interface that Facter seems to prefer over the real interface.

I think a good way forward is probably not to rely on a Fact at all, but to add an API parameter to Discovers#create, and > then discover the correct device in the bin/discover_host script. We could also add an optional kernel cmdline override as > well, for when the discovery image is somehow getting it wrong.

Actions #1

Updated by Tomasz Nowak about 11 years ago

As I mentioned on the mailinglist, I have a requirement in my environment to use serial number as the default host name for some specific subnets, and for other machines host name will be entered from the keyboard (as the hostname is determined by the label attached to the machine).

I have my site specific code on in discovery_init.sh script (to decide what default hostname will be based on kernel parameters, subnet, keyboard input, etc), so it only the matter of adding new API (or define a new fact that going to be used as preferred hostname for discovered hosts).

Actions #2

Updated by Greg Sutcliffe almost 11 years ago

  • Translation missing: en.field_release set to 2
Actions #3

Updated by Greg Sutcliffe almost 11 years ago

  • Target version set to 1.9.2
Actions #4

Updated by Greg Sutcliffe almost 11 years ago

  • Is duplicate of Bug #3921: Choice of fact for MAC is inconsistent bewteen TCL and RPM images added
Actions #5

Updated by Greg Sutcliffe almost 11 years ago

  • Is duplicate of deleted (Bug #3921: Choice of fact for MAC is inconsistent bewteen TCL and RPM images)
Actions #6

Updated by Greg Sutcliffe almost 11 years ago

  • Target version deleted (1.9.2)
  • Translation missing: en.field_release deleted (2)
Actions #7

Updated by Anonymous over 10 years ago

  • Target version set to 1.9.0
Actions #8

Updated by Anonymous over 10 years ago

  • Target version deleted (1.9.0)
Actions #9

Updated by Ori Rabin about 10 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF