Project

General

Profile

Actions

Bug #9029

closed

discovery rule hostname is not clear

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

Status:
Closed
Priority:
Normal
Category:
Discovery plugin
Difficulty:
Triaged:
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 1 (0 open1 closed)

Related to Discovery - Bug #9077: Hostname templating does not work with facts_hashClosedLukas Zapletal01/22/2015Actions
Actions #1

Updated by Lukas Zapletal about 9 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.

Actions #2

Updated by Lukas Zapletal about 9 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).

Actions #3

Updated by Lukas Zapletal about 9 years ago

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

Updated by The Foreman Bot about 9 years ago

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

Updated by Ori Rabin about 9 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)
Actions #6

Updated by Anonymous about 9 years ago

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

Also available in: Atom PDF