Module: Chef::Sugar::IP

Extended by:
IP
Included in:
IP
Defined in:
lib/chef/sugar/dip/ip.rb

Instance Method Summary collapse

Instance Method Details

#public_ip(node) ⇒ String

Return node’s public IP

Parameters:

  • node (Chef::Node)

    the node to calculate the public IP for

Returns:

  • (String)

    the node’s ip address



31
32
33
# File 'lib/chef/sugar/dip/ip.rb', line 31

def public_ip(node)
  node['cloud'] ? node['cloud']['public_ipv4'] : node['ipaddress']
end