Bug #9029
closed
discovery rule hostname is not clear
Added by Ohad Levy about 10 years ago.
Updated about 10 years ago.
Category:
Discovery plugin
|
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?
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.
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).
- Related to Bug #9077: Hostname templating does not work with facts_hash added
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_discovery/pull/132 added
- Pull request deleted (
)
- 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)
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF