Project

General

Profile

Bug #9029

discovery rule hostname is not clear

Added by Ohad Levy about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Discovery plugin
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

the usage of this input is not clear, if its a prefix it should be called hostname prefix, alternatively provide an example in an inline help or link to documentation?


Related issues

Related to Discovery - Bug #9077: Hostname templating does not work with facts_hashClosed2015-01-22

Associated revisions

Revision 6c8df37a (diff)
Added by Lukas Zapletal about 5 years ago

Fixes #9029 - popup for discovery rule hostname

History

#1 Updated by Lukas Zapletal about 5 years ago

It's actually an ERB template, all our templating help is valid plus we added two more functions: rand and facts_hash to be used.

#2 Updated by Lukas Zapletal about 5 years ago

Here is the text we can show in help baloon or something:

Hostname for provisioned hosts. Domain will be appended automatically. A hostname based on MAC address will be used when left blank. Use ERB templating to access host attributes and facts. Examples:

  • myhost-<%= rand(99999) %>
  • myhost-<%= @host.facts['bios_vendor'] + '-' + rand(99999) %>
  • myhost-<%= @host.hostgroup.name %>
  • myhost-<%= @host.discovery_rule.name %>
  • myhost-<%= @host.ip.gsub('.','-') + '-' + @host.hostgroup.subnet.name %>

When creating hostname patterns, make sure the resulting host names are unique. Good approach is to use unique information provided by facter (MAC address, BIOS or serial ID).

#3 Updated by Lukas Zapletal about 5 years ago

  • Related to Bug #9077: Hostname templating does not work with facts_hash added

#4 Updated by The Foreman Bot about 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_discovery/pull/132 added
  • Pull request deleted ()

#5 Updated by Ori Rabin about 5 years ago

  • Assignee set to Lukas Zapletal
  • Pull request https://github.com/theforeman/foreman_discovery/pull/133 added
  • Pull request deleted (https://github.com/theforeman/foreman_discovery/pull/132)

#6 Updated by Anonymous about 5 years ago

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

Also available in: Atom PDF