Feature #6134
closedDiscovered hosts are always prefixed with "mac"
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.
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.
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?
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.
Updated by Ori Rabin about 10 years ago
- Status changed from New to Assigned
- Assignee set to Ori Rabin
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 (
)
Updated by Ori Rabin about 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset b221e9c791b3c7ca680ca8113157698f9a16be6f.