Then after the first puppet run the resulting configuration file contains and empty IP
:22
instead of
10.0.84.69:22
The following puppet run does set the proper IP in the file.
I’ve tested this behavior a few times on a test VM (deleting the host and recreating it in Foreman to clear the host’s facts) and can confirm the behavior.
Is this “by design” or is it a bug ?
Expected outcome: Foreman puppet ENC values based on puppet facts are resolved even on the first puppet run (since puppet facts are gathered prior to catalogue compilation).
“by design” as the ENC runs first to compile the catalog. If a value is not known to it yet it can not included in the ENC and the facts are collected only during the run. This is why your problem is fixed after the first run by itself.
You could avoid this by using not the reported fact, but the configured value. You should have access to all interfaces. I recommend looking at the Template DSL or API documentation available on the About page (I have no access to my system at the moment).