original_docstring: Build out all containers as defined in the environment file.
  
      :param container_skel: ``dict`` container skeleton for all known containers
      :param inventory: ``dict``  Living dictionary of inventory
      :param config: ``dict``  User defined information
      
docstring: Build out all containers as defined in the environment file.
docstring_tokens: Build out all containers as defined in the environment file .
code: def container_skel_load(container_skel, inventory, config):
      """Build out all containers as defined in the environment file.
  
      :param container_skel: ``dict`` container skeleton for all known containers
      :param inventory: ``dict``  Living dictionary of inventory
      :param config: ``dict``  User defined information
      """
      for key, value in container_skel.iteritems():
          for assignment in value['contains']:
              for container_type in value['belongs_to']:
                  _add_container_hosts(
                      assignment,
                      config,
                      key,
                      container_type,
                      inventory,
                      value.get('is_metal', False)
                  )
      else:
          cidr_networks = config.get('cidr_networks')
          provider_queues = {}
          for net_name in cidr_networks:
              ip_q = _load_optional_q(
                  cidr_networks, cidr_name=net_name
              )
              provider_queues[net_name] = ip_q
              if ip_q is not None:
                  net = netaddr.IPNetwork(cidr_networks.get(net_name))
                  provider_queues['%s_netmask' % net_name] = str(net.netmask)
  
          overrides = config['global_overrides']
          mgmt_bridge = overrides['management_bridge']
          mgmt_dict = {}
          if cidr_networks:
              for pn in overrides['provider_networks']:
                  network = pn['network']
                  if 'ip_from_q' in network and 'group_binds' in network:
                      q_name = network['ip_from_q']
                      for group in network['group_binds']:
                          _add_additional_networks(
                              key=group,
                              inventory=inventory,
                              ip_q=provider_queues[q_name],
                              k_name=q_name,
                              netmask=provider_queues['%s_netmask' % q_name]
                          )
  
                  if mgmt_bridge == network['container_bridge']:
                      nci = network['container_interface']
                      ncb = network['container_bridge']
                      ncn = network.get('ip_from_q')
                      mgmt_dict['container_interface'] = nci
                      mgmt_dict['container_bridge'] = ncb
                      if ncn:
                          cidr_net = netaddr.IPNetwork(cidr_networks.get(ncn))
                          mgmt_dict['container_netmask'] = str(cidr_net.netmask)
  
          for host, hostvars in inventory['_meta']['hostvars'].iteritems():
              base_hosts = inventory['_meta']['hostvars'][host]
              if 'container_network' not in base_hosts:
                  base_hosts['container_network'] = mgmt_dict
  
              for _key, _value in hostvars.iteritems():
                  if _key == 'ansible_ssh_host' and _value is None:
                      ca = base_hosts['container_address']
                      base_hosts['ansible_ssh_host'] = ca
code_tokens: def container_skel_load ( container_skel , inventory , config ) : for key , value in container_skel . iteritems ( ) : for assignment in value [ 'contains' ] : for container_type in value [ 'belongs_to' ] : _add_container_hosts ( assignment , config , key , container_type , inventory , value . get ( 'is_metal' , False ) ) else : cidr_networks = config . get ( 'cidr_networks' ) provider_queues = { } for net_name in cidr_networks : ip_q = _load_optional_q ( cidr_networks , cidr_name = net_name ) provider_queues [ net_name ] = ip_q if ip_q is not None : net = netaddr . IPNetwork ( cidr_networks . get ( net_name ) ) provider_queues [ '%s_netmask' % net_name ] = str ( net . netmask ) overrides = config [ 'global_overrides' ] mgmt_bridge = overrides [ 'management_bridge' ] mgmt_dict = { } if cidr_networks : for pn in overrides [ 'provider_networks' ] : network = pn [ 'network' ] if 'ip_from_q' in network and 'group_binds' in network : q_name = network [ 'ip_from_q' ] for group in network [ 'group_binds' ] : _add_additional_networks ( key = group , inventory = inventory , ip_q = provider_queues [ q_name ] , k_name = q_name , netmask = provider_queues [ '%s_netmask' % q_name ] ) if mgmt_bridge == network [ 'container_bridge' ] : nci = network [ 'container_interface' ] ncb = network [ 'container_bridge' ] ncn = network . get ( 'ip_from_q' ) mgmt_dict [ 'container_interface' ] = nci mgmt_dict [ 'container_bridge' ] = ncb if ncn : cidr_net = netaddr . IPNetwork ( cidr_networks . get ( ncn ) ) mgmt_dict [ 'container_netmask' ] = str ( cidr_net . netmask ) for host , hostvars in inventory [ '_meta' ] [ 'hostvars' ] . iteritems ( ) : base_hosts = inventory [ '_meta' ] [ 'hostvars' ] [ host ] if 'container_network' not in base_hosts : base_hosts [ 'container_network' ] = mgmt_dict for _key , _value in hostvars . iteritems ( ) : if _key == 'ansible_ssh_host' and _value is None : ca = base_hosts [ 'container_address' ] base_hosts [ 'ansible_ssh_host' ] = ca
short_docstring: Build out all containers as defined in the environment file.
short_docstring_tokens: Build out all containers as defined in the environment file .
comment: """Build out all containers as defined in the environment file.
  
      :param container_skel: ``dict`` container skeleton for all known containers
      :param inventory: ``dict``  Living dictionary of inventory
      :param config: ``dict``  User defined information
      """