How get host's ip address from foreman database in puppet manifest

> Please help.
> I read this note
> How i can get host's ip address from foreman?
> The following expression $hostlist = database foreman("hosts", "name =
> ${fqdn}") put this result:
> [{"host"=>{"operatingsystem_id"=>9, "id"=>23, "hostgroup_id"=>1,
> "name"=>"sphinx1.torg.local"}}]
> But what query get host's ip from database?

Currently the host info that is return is pretty limited (there is a
different response when calling for a collection of hosts vs a single host

  • which would yield much more info about the system).

if you are looking for the ip, I suggest you use facts base search instead
for now, or, you can add / change the function to query for a single host
instead of using a search (e.g. query /hosts/fqdn instead of


··· On Tue, Oct 9, 2012 at 8:40 AM, Vlados Vlados wrote:

You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at