Project

General

Profile

Actions

Feature #23729

closed

Provide better hostname generator examples

Added by Lukas Zapletal over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Difficulty:
trivial
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Our discovery rule hostname example with rand() method do not work: abc-<%= @host.facts['bios_vendor'] + '-' + rand(99999) %>

Errors out with: TypeError (no implicit conversion of Integer into String) and "to_s" call must be added. Let's add that to the example screen.

We should also provide some new helpers and allow them in safemode:

- rand_hex(n) - returns SecureRandom.hex(n)
- rand_name - returns NameGenerator.new.next_random_name
- mac_name(mac_address) - returns NameGenerator.new.next_mac_name(mac_address)

Add those to the examples. Note NameGenerator is part of Foreman Core.


Related issues 2 (0 open2 closed)

Related to Discovery - Feature #16330: Give reasonable names to discovered hosts via deaconClosedLukas Zapletal08/26/2016Actions
Related to Foreman - Feature #25679: Provide better hostname generator examples with safemode enabledClosedAditi PuntambekarActions
Actions

Also available in: Atom PDF