X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/89634c26de56cac77a87cfed1b36770e7f144c59..b413a8a17bc14d4503fe4d6432223a5f45c5286e:/cookbooks/networking/libraries/ipaddresses.rb?ds=sidebyside diff --git a/cookbooks/networking/libraries/ipaddresses.rb b/cookbooks/networking/libraries/ipaddresses.rb index d31d885f9..67c89d052 100644 --- a/cookbooks/networking/libraries/ipaddresses.rb +++ b/cookbooks/networking/libraries/ipaddresses.rb @@ -6,6 +6,8 @@ class Chef interfaces(options).each do |interface| address = interface[:public_address] || interface[:address] + next if address.nil? + if block.nil? addresses << address else @@ -16,12 +18,12 @@ class Chef addresses end - def internal_ipaddress - ipaddresses(:role => :internal).first + def internal_ipaddress(options = {}) + ipaddresses(options.merge(:role => :internal)).first end - def external_ipaddress - ipaddresses(:role => :external).first + def external_ipaddress(options = {}) + ipaddresses(options.merge(:role => :external)).first end end end