X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/f30f230da23603e3c7598205219ce01e9820c470..cac6ace6749429cdc77d0f1c0bac4890838d0861:/cookbooks/networking/libraries/ipaddresses.rb?ds=sidebyside diff --git a/cookbooks/networking/libraries/ipaddresses.rb b/cookbooks/networking/libraries/ipaddresses.rb index 51ef152b5..9fde5610b 100644 --- a/cookbooks/networking/libraries/ipaddresses.rb +++ b/cookbooks/networking/libraries/ipaddresses.rb @@ -4,10 +4,14 @@ class Chef addresses = [] interfaces(options).each do |interface| + address = interface[:public_address] || interface[:address] + + next if address.nil? + if block.nil? - addresses << interface[:address] + addresses << address else - yield interface[:address] + yield address end end