cookbooks/arcgis-enterprise/libraries/portal_admin_client.rb
# Select the machine name that corresponds to the local machine IP address
# from the list of machines returned by /portaladmin/machines call.
Select the machine name that corresponds to the local machine IP address
from the list of machines returned by /portaladmin/machines call.
Select the machine name that corresponds to the local machine IP address from the list of machines returned by / portaladmin / machines call .
def local_machine_name
      local_ip_addresses = Socket.ip_address_list
      machines.each do |machine|
        if local_ip_addresses.any? { |a| a.ip_address == Addrinfo.ip(machine['machineName']).ip_address }
          return machine['machineName']
        end
      end
      Socket.gethostname
    end
def local_machine_name local_ip_addresses = Socket . ip_address_list machines . each do | machine | if local_ip_addresses . any? { | a | a . ip_address == Addrinfo . ip ( machine [ 'machineName' ] ) . ip_address } return machine [ 'machineName' ] end end Socket . gethostname end
Select the machine name that corresponds to the local machine IP address
from the list of machines returned by /portaladmin/machines call.
Select the machine name that corresponds to the local machine IP address from the list of machines returned by / portaladmin / machines call .
# Get local IP addresses as an array.