original_docstring: Add in all of hte host associations into inventory.
  
      This will add in all of the hosts into the inventory based on the given
      affinity for a container component and its subsequent type groups.
  
      :param container_affinity: ``int`` Set the number of a given container
      :param container_hosts: ``list`` List of containers on an host
      :param type_and_name: ``str`` Combined name of host and container name
      :param inventory: ``dict``  Living dictionary of inventory
      :param host_type: ``str``  Name of the host type
      :param container_type: ``str``  Type of container
      :param container_host_type: ``str`` Type of host
      :param physical_host_type: ``str``  Name of physical host group
      :param config: ``dict``  User defined information
      :param is_metal: ``bol``  If true, a container entry will not be built
      :param assignment: ``str`` Name of container component target
      
docstring: Add in all of hte host associations into inventory.
  This will add in all of the hosts into the inventory based on the given
  affinity for a container component and its subsequent type groups.
docstring_tokens: Add in all of hte host associations into inventory . This will add in all of the hosts into the inventory based on the given affinity for a container component and its subsequent type groups .
code: def _build_container_hosts(container_affinity, container_hosts, type_and_name,
                             inventory, host_type, container_type,
                             container_host_type, physical_host_type, config,
                             is_metal, assignment):
      """Add in all of hte host associations into inventory.
  
      This will add in all of the hosts into the inventory based on the given
      affinity for a container component and its subsequent type groups.
  
      :param container_affinity: ``int`` Set the number of a given container
      :param container_hosts: ``list`` List of containers on an host
      :param type_and_name: ``str`` Combined name of host and container name
      :param inventory: ``dict``  Living dictionary of inventory
      :param host_type: ``str``  Name of the host type
      :param container_type: ``str``  Type of container
      :param container_host_type: ``str`` Type of host
      :param physical_host_type: ``str``  Name of physical host group
      :param config: ``dict``  User defined information
      :param is_metal: ``bol``  If true, a container entry will not be built
      :param assignment: ``str`` Name of container component target
      """
      container_list = []
      for make_container in range(container_affinity):
          for i in container_hosts:
              if '%s-' % type_and_name in i:
                  append_if(array=container_list, item=i)
  
          existing_count = len(list(set(container_list)))
          if existing_count < container_affinity:
              hostvars = inventory['_meta']['hostvars']
              container_mapping = inventory[container_type]['children']
              address = None
  
              if is_metal is False:
                  cuuid = '%s' % uuid.uuid4()
                  cuuid = cuuid.split('-')[0]
                  container_host_name = '%s-%s' % (type_and_name, cuuid)
                  hostvars_options = hostvars[container_host_name] = {}
                  if container_host_type not in inventory:
                      inventory[container_host_type] = {
                          "hosts": [],
                      }
  
                  append_if(
                      array=inventory[container_host_type]["hosts"],
                      item=container_host_name
                  )
                  append_if(array=container_hosts, item=container_host_name)
              else:
                  if host_type not in hostvars:
                      hostvars[host_type] = {}
  
                  hostvars_options = hostvars[host_type]
                  container_host_name = host_type
                  host_type_config = config[physical_host_type][host_type]
                  address = host_type_config.get('ip')
  
              # Create a host types containers group and append it to inventory
              host_type_containers = '%s_containers' % host_type
              append_if(array=container_mapping, item=host_type_containers)
  
              hostvars_options.update({
                  'is_metal': is_metal,
                  'ansible_ssh_host': address,
                  'container_address': address,
                  'container_name': container_host_name,
                  'physical_host': host_type,
                  'component': assignment
              })
code_tokens: def _build_container_hosts ( container_affinity , container_hosts , type_and_name , inventory , host_type , container_type , container_host_type , physical_host_type , config , is_metal , assignment ) : container_list = [ ] for make_container in range ( container_affinity ) : for i in container_hosts : if '%s-' % type_and_name in i : append_if ( array = container_list , item = i ) existing_count = len ( list ( set ( container_list ) ) ) if existing_count < container_affinity : hostvars = inventory [ '_meta' ] [ 'hostvars' ] container_mapping = inventory [ container_type ] [ 'children' ] address = None if is_metal is False : cuuid = '%s' % uuid . uuid4 ( ) cuuid = cuuid . split ( '-' ) [ 0 ] container_host_name = '%s-%s' % ( type_and_name , cuuid ) hostvars_options = hostvars [ container_host_name ] = { } if container_host_type not in inventory : inventory [ container_host_type ] = { "hosts" : [ ] , } append_if ( array = inventory [ container_host_type ] [ "hosts" ] , item = container_host_name ) append_if ( array = container_hosts , item = container_host_name ) else : if host_type not in hostvars : hostvars [ host_type ] = { } hostvars_options = hostvars [ host_type ] container_host_name = host_type host_type_config = config [ physical_host_type ] [ host_type ] address = host_type_config . get ( 'ip' ) host_type_containers = '%s_containers' % host_type append_if ( array = container_mapping , item = host_type_containers ) hostvars_options . update ( { 'is_metal' : is_metal , 'ansible_ssh_host' : address , 'container_address' : address , 'container_name' : container_host_name , 'physical_host' : host_type , 'component' : assignment } )
short_docstring: Add in all of hte host associations into inventory.
short_docstring_tokens: Add in all of hte host associations into inventory .
comment: """Add in all of hte host associations into inventory.
  
      This will add in all of the hosts into the inventory based on the given
      affinity for a container component and its subsequent type groups.
  
      :param container_affinity: ``int`` Set the number of a given container
      :param container_hosts: ``list`` List of containers on an host
      :param type_and_name: ``str`` Combined name of host and container name
      :param inventory: ``dict``  Living dictionary of inventory
      :param host_type: ``str``  Name of the host type
      :param container_type: ``str``  Type of container
      :param container_host_type: ``str`` Type of host
      :param physical_host_type: ``str``  Name of physical host group
      :param config: ``dict``  User defined information
      :param is_metal: ``bol``  If true, a container entry will not be built
      :param assignment: ``str`` Name of container component target
      """$SEP$# Create a host types containers group and append it to inventory