0

How can I use a puppet/facter fact like ${$::hostname} in a Foreman smart class parameter?

I've tried $hostname and $::hostname and just about every variant I can think of! I've even trawled through Google and Foreman docs and bug reports. Surely there's a simple answer?

Chris Pitman
  • 12,990
  • 3
  • 41
  • 56
Kier
  • 55
  • 2
  • 10

1 Answers1

1

It's an old question, but you use facts like you do in a ERB template, example:

<%= @host.shortname %>

would get you xyz of xyz.example.com

Matthew Verstraete
  • 6,335
  • 22
  • 67
  • 123
RyanMJ
  • 11
  • 4
  • Hi. Thank you for your answer. How to get the FQDN of a host? `<%= @fqdn %>` returns an empty string, and I cannot find any documentation where you got the shortname from, I cannot find it in any fact documentation. Edit: Found the documentation. – Daniel Feb 15 '18 at 11:07