Project

General

Profile

Actions

Feature #6134

closed

Discovered hosts are always prefixed with "mac"

Added by Konstantin Orekhov over 10 years ago. Updated almost 10 years ago.

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

Description

Current way of using a MAC address to generate a hostname for a discovered host poses some limitations during life-cycle of the machine. For example, a MB or NIC card replacement would cause MAC addresses to be updated causing a hostname change as well. If there's an ability to specify a fact name in discovery plug-in just like discovery_bootif to override the default using macaddress, it'll provide an easy way for people like to use say "serialnumber" fact in a hostname or something like that.

Actions #1

Updated by Roger K over 10 years ago

is this not supported by the discovery_fact setting?

https://github.com/theforeman/foreman_discovery/blob/develop/app/models/host/discovered.rb#L30-31

it does prefix the name with "mac" regardless of what fact you set, which is irritating. for example, if a Dell had the serialnumber DDZVK31, the hostname would get set to macddzvk31 which is ugly and wrong.

Actions #2

Updated by Lukas Zapletal over 10 years ago

  • Subject changed from Add an ability to use arbitrary fact as the "hostname" for newly discovered hosts to Discovered hosts are always prefixed with "mac"

Roger is right, Konstantin. You can do this today, but we have a bug when your hostname will be always prefixed by "mac". This is because hostname MUST start with letter, not number.

We need to fix this by either making the "mac" string configurable, or adding it only when the resulting hostname does not start with a letter (which is ugly). I am all for the former. Greg?

Actions #3

Updated by Greg Sutcliffe over 10 years ago

Lukas Zapletal wrote:

We need to fix this by either making the "mac" string configurable, or adding it only when the resulting hostname does not start with a letter (which is ugly). I am all for the former. Greg?

+1 to making that string configurable.

Actions #4

Updated by Ori Rabin about 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin
Actions #5

Updated by The Foreman Bot about 10 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_discovery/pull/94 added
  • Pull request deleted ()
Actions #6

Updated by Ori Rabin about 10 years ago

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

Also available in: Atom PDF