original_docstring: Apply user defined entries from config into inventory.
  
      :param config: ``dict``  User defined information
      :param inventory: ``dict``  Living dictionary of inventory
      :param is_metal: ``bol``  If true, a container entry will not be built
      
docstring: Apply user defined entries from config into inventory.
docstring_tokens: Apply user defined entries from config into inventory .
code: def user_defined_setup(config, inventory, is_metal):
      """Apply user defined entries from config into inventory.
  
      :param config: ``dict``  User defined information
      :param inventory: ``dict``  Living dictionary of inventory
      :param is_metal: ``bol``  If true, a container entry will not be built
      """
      for key, value in config.iteritems():
          if key.endswith('hosts'):
              if key not in inventory:
                  inventory[key] = {'hosts': []}
  
              if value is None:
                  return
  
              for _key, _value in value.iteritems():
                  if _key not in inventory['_meta']['hostvars']:
                      inventory['_meta']['hostvars'][_key] = {}
  
                  inventory['_meta']['hostvars'][_key].update({
                      'ansible_ssh_host': _value['ip'],
                      'container_address': _value['ip'],
                      'is_metal': is_metal,
                  })
  
                  if 'host_vars' in _value:
                      for _k, _v in _value['host_vars'].items():
                          inventory['_meta']['hostvars'][_key][_k] = _v
  
                  append_if(array=USED_IPS, item=_value['ip'])
                  append_if(array=inventory[key]['hosts'], item=_key)
code_tokens: def user_defined_setup ( config , inventory , is_metal ) : for key , value in config . iteritems ( ) : if key . endswith ( 'hosts' ) : if key not in inventory : inventory [ key ] = { 'hosts' : [ ] } if value is None : return for _key , _value in value . iteritems ( ) : if _key not in inventory [ '_meta' ] [ 'hostvars' ] : inventory [ '_meta' ] [ 'hostvars' ] [ _key ] = { } inventory [ '_meta' ] [ 'hostvars' ] [ _key ] . update ( { 'ansible_ssh_host' : _value [ 'ip' ] , 'container_address' : _value [ 'ip' ] , 'is_metal' : is_metal , } ) if 'host_vars' in _value : for _k , _v in _value [ 'host_vars' ] . items ( ) : inventory [ '_meta' ] [ 'hostvars' ] [ _key ] [ _k ] = _v append_if ( array = USED_IPS , item = _value [ 'ip' ] ) append_if ( array = inventory [ key ] [ 'hosts' ] , item = _key )
short_docstring: Apply user defined entries from config into inventory.
short_docstring_tokens: Apply user defined entries from config into inventory .
comment: """Apply user defined entries from config into inventory.
  
      :param config: ``dict``  User defined information
      :param inventory: ``dict``  Living dictionary of inventory
      :param is_metal: ``bol``  If true, a container entry will not be built
      """