On Aug 14, 2011 1:49 PM, "Haim Ashkenazi" < " target="_blank"> > wrote:
> I was wondering if there's an easy way to get the ip address of a specific interface (and not just the main ip adders)?It isn't as easy as it should be, but you can use this code to do it:
http://tickets.opscode.com/browse/OHAI-88
ipaddress_eth1 = host["network"]["interfaces"]["eth1"]["addresses"].select { |address, data| data["family"] == "inet" }[0][0]
Bryan
Archive powered by MHonArc 2.6.16.