In my last post I described how the top level facts have changed in format. Today I came across a similar problem, namely how to determine the Fully Qualified Domain Name (FQDN).
There used to be a simple fact for it: $::fqdn
. I use that a lot in all my custom puppet modules.
Nut that does not work anymore and throws an error: Unknown Variable
.
However, the new scheme $facts[hostname] or $facts[fqdn] does not work either. It does not throw an error, but it also does not return a value.
The short answer: It is now $servername
. Logical, isn't it?
So in my params.pp I do this: $fqdn = $servername
. This way I don't have to rewrite all my code but only one variable in params.pp
Happy coding.