Bug #9029
closeddiscovery rule hostname is not clear
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?
Updated by Lukas Zapletal about 10 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.
Updated by Lukas Zapletal about 10 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).
Updated by Lukas Zapletal about 10 years ago
- Related to Bug #9077: Hostname templating does not work with facts_hash added
Updated by The Foreman Bot about 10 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_discovery/pull/132 added
- Pull request deleted (
)
Updated by Ori Rabin about 10 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)
Updated by Anonymous about 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_discovery|6c8df37ac215cbd97a3fe79cab2de694b3810710.