original_docstring: Process additional ip adds and append then to hosts as needed.
  
      If the host is found to be "is_metal" it will be marked as "on_metal"
      and will not have an additionally assigned IP address.
  
      :param key: ``str`` Component key name
      :param inventory: ``dict``  Living dictionary of inventory
      :param ip_q: ``object`` build queue of IP addresses
      :param k_name: ``str`` key to use in host vars for storage
      
docstring: Process additional ip adds and append then to hosts as needed.
  If the host is found to be "is_metal" it will be marked as "on_metal"
  and will not have an additionally assigned IP address.
docstring_tokens: Process additional ip adds and append then to hosts as needed . If the host is found to be " is_metal " it will be marked as " on_metal " and will not have an additionally assigned IP address .
code: def _add_additional_networks(key, inventory, ip_q, k_name, netmask):
      """Process additional ip adds and append then to hosts as needed.
  
      If the host is found to be "is_metal" it will be marked as "on_metal"
      and will not have an additionally assigned IP address.
  
      :param key: ``str`` Component key name
      :param inventory: ``dict``  Living dictionary of inventory
      :param ip_q: ``object`` build queue of IP addresses
      :param k_name: ``str`` key to use in host vars for storage
      """
      base_hosts = inventory['_meta']['hostvars']
      addr_name = '%s_address' % k_name
      lookup = inventory.get(key, list())
  
      if 'children' in lookup and lookup['children']:
          for group in lookup['children']:
              _add_additional_networks(group, inventory, ip_q, k_name, netmask)
  
      if 'hosts' in lookup and lookup['hosts']:
          for chost in lookup['hosts']:
              container = base_hosts[chost]
              if not container.get(addr_name):
                  if ip_q is None:
                      container[addr_name] = None
                  else:
                      container[addr_name] = get_ip_address(
                          name=k_name, ip_q=ip_q
                      )
  
              netmask_name = '%s_netmask' % k_name
              if netmask_name not in container:
                  container[netmask_name] = netmask
code_tokens: def _add_additional_networks ( key , inventory , ip_q , k_name , netmask ) : base_hosts = inventory [ '_meta' ] [ 'hostvars' ] addr_name = '%s_address' % k_name lookup = inventory . get ( key , list ( ) ) if 'children' in lookup and lookup [ 'children' ] : for group in lookup [ 'children' ] : _add_additional_networks ( group , inventory , ip_q , k_name , netmask ) if 'hosts' in lookup and lookup [ 'hosts' ] : for chost in lookup [ 'hosts' ] : container = base_hosts [ chost ] if not container . get ( addr_name ) : if ip_q is None : container [ addr_name ] = None else : container [ addr_name ] = get_ip_address ( name = k_name , ip_q = ip_q ) netmask_name = '%s_netmask' % k_name if netmask_name not in container : container [ netmask_name ] = netmask
short_docstring: Process additional ip adds and append then to hosts as needed.
short_docstring_tokens: Process additional ip adds and append then to hosts as needed .
comment: """Process additional ip adds and append then to hosts as needed.
  
      If the host is found to be "is_metal" it will be marked as "on_metal"
      and will not have an additionally assigned IP address.
  
      :param key: ``str`` Component key name
      :param inventory: ``dict``  Living dictionary of inventory
      :param ip_q: ``object`` build queue of IP addresses
      :param k_name: ``str`` key to use in host vars for storage
      """