associated with this network net = IPAddr.new(node[“osops_networks"][network]) ! ! # loop thru node's interfaces and look at addresses node["network"]["interfaces"].each do |interface| # ohai Ͱ interfaces Λऔಘ ! ! Chef::Log.debug("#{ourname} examining interface #{interface[0]}") if interface[1].has_key?("addresses") then # loop thru each address on this interface interface[1]["addresses"].each do |k, v| if v["family"] == "inet6" or (v["family"] == "inet" and v["prefixlen"] != "32") then ! addr=IPAddr.new(k) if net.include?(addr) Chef::Log.debug(ourname + " ===> using #{addr}") return k # found it else Chef::Log.debug(ourname + " - ignoring #{addr}") end environment Ͱࢦఆͨ͠ωοτϫʔΫΞυϨε chef αʔόʹ node ͷશ NW I/F ใΛऔಘ͠ʹ ࢦఆͨ͠ωοτϫʔΫʹଐͨ͠ I/F ͷ IP ΞυϨεΛԠ