question: is there a way to do interpolation in hi...
# puppet
j
question: is there a way to do interpolation in hiera data values? something like
Copy code
---
testing: %{trusted.certname}
i don't think there is, but i figure it can't hurt to ask 😁
ooh, turns out you can have
%{xxx}
in the data ... what doesn't work is typos like
%(xxx}
... sorry for wasting everybody's time
looks like
%{trusted.certname}
works, but
%{facts.hostname}
(for the "short" hostname) does not ... strange
looks like
%{trusted.hostname}
has what i need. i had forgotten that
trusted
had that in there.
n
Could be because
facts.hostname
is a legacy fact.
trusted.hostname
is definitely preferred, because that can't easily be spoofed. But for reference, I bet
facts.networking.hostname
would also work.
j
i'll try that ... but running
facter hostname
on the target machine does return the machine's "short hostname"
i tried adding
%{facts}
to a data value to dump all of it ... you were right,
facts.hostname
is not there, but
facts.networking.hostname
is.
b
Yup don't use legacy facts