Problem: I would need a report which includes all ipaddresses and macadresses of the hosts existing in Foreman. This is needed to be imported in a CMDB. Getting the primary ip and mac is no problem but then it gets difficult for multiple reasons. The systems are not provisioned with Foreman, so the hosts are created when they are registered via subscription-manager or reported by Ansible, resulting in only the first interface being set to managed. The facts hash in the reports does not return anything if I did not specify the full “path”.
So what I tried:
host.ip / host.mac → works fine but only provides infos about the primary interface
host.managed_interfaces → return only the primary interface in this environment
host.facts[‘net::interfaces::bond0::mac_address’] → works fine if I know the interface
host.facts[‘net::interfaces’] → returns null so I can not iterate
Any idea how to get this working?
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Distribution and version: