Hello,
Is there a way to get the puppet master IP from a provisioning template
(finish or userdata)?
I'm using <%= @host.puppetmaster %> to get the fqdn but I don't find
anything to get the management IP (host cannot resolve)
Thanks,
Anthony
Hello,
Is there a way to get the puppet master IP from a provisioning template
(finish or userdata)?
I'm using <%= @host.puppetmaster %> to get the fqdn but I don't find
anything to get the management IP (host cannot resolve)
Thanks,
Anthony
There's no guarantee the puppetmaster is in Foreman's db - it gets the fqdn
from the puppet proxy assigned to the host, from the smart proxies table.
Assuming it is in the db, you could do something like:
<%= Host.find(@host.puppetmaster).ip %>
but that will almost certianly require you to disable safe_mode in the
settings - something we don't generally recommend.
Greg
Hello,
Is there a way to get the puppet master IP from a provisioning template
(finish or userdata)?I’m using <%= @host.puppetmaster %> to get the fqdn but I don’t find
anything to get the management IP (host cannot resolve)
Thanks a lot Greg, it is working fine!
Any chance to have a supported macro in a future version?
Personally I think it's tricky since there's no requirement to know
anything about the puppetmaster - but others may have solutions I've not
thought of. Feel free to raise a ticket if you like
http://projects.theforeman.org/projects/foreman/issues/new
Greg
Thanks a lot Greg, it is working fine!
Any chance to have a supported macro in a future version?