X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/3a4b1c2078cd515e93a5f1bf8967f380fbd1646f..89634c26de56cac77a87cfed1b36770e7f144c59:/cookbooks/networking/libraries/ipaddresses.rb diff --git a/cookbooks/networking/libraries/ipaddresses.rb b/cookbooks/networking/libraries/ipaddresses.rb index 5eb54265e..d31d885f9 100644 --- a/cookbooks/networking/libraries/ipaddresses.rb +++ b/cookbooks/networking/libraries/ipaddresses.rb @@ -4,10 +4,12 @@ class Chef addresses = [] interfaces(options).each do |interface| + address = interface[:public_address] || interface[:address] + if block.nil? - addresses << interface[:address] + addresses << address else - block.call(interface[:address]) + yield address end end