(self, data)
Inventory loading has two stages. The groups dictionary contains
        both 'vars' for each group as well as 'hosts', which is a dictionary
        of hostnames where the values are host specific variables. 

        These host specific variables are NOT only used with that group, but
        it's just a convenient way to define host variables and group membership
        at the same time.
Inventory loading has two stages. The groups dictionary contains
        both 'vars' for each group as well as 'hosts', which is a dictionary
        of hostnames where the values are host specific variables.
Inventory loading has two stages . The groups dictionary contains both vars for each group as well as hosts which is a dictionary of hostnames where the values are host specific variables .
def _process_groups(self, data):
        """
        Inventory loading has two stages. The groups dictionary contains
        both 'vars' for each group as well as 'hosts', which is a dictionary
        of hostnames where the values are host specific variables. 

        These host specific variables are NOT only used with that group, but
        it's just a convenient way to define host variables and group membership
        at the same time.
        """

        groups = data.get('groups', dict())

        # traverse the dictionary of group names, where each value contains
        # a dictionary of hosts and a dictionary of group variables
        for (group_name, group_data) in data['groups'].items():
            group_vars = group_data.get('vars', dict())
            group = self._get_or_create_group(group_name, group_vars)
            hosts = group_data.get('hosts', dict())
            # now walk each host in the group specification
            for (host_name, host_data) in hosts.items():
                host_data = self._shlex_parse(host_data)
                host = self._get_or_create_host(host_name, host_data)
                group.add_host(host)
                host.add_group(group)
def _process_groups ( self , data ) : groups = data . get ( 'groups' , dict ( ) ) # traverse the dictionary of group names, where each value contains # a dictionary of hosts and a dictionary of group variables for ( group_name , group_data ) in data [ 'groups' ] . items ( ) : group_vars = group_data . get ( 'vars' , dict ( ) ) group = self . _get_or_create_group ( group_name , group_vars ) hosts = group_data . get ( 'hosts' , dict ( ) ) # now walk each host in the group specification for ( host_name , host_data ) in hosts . items ( ) : host_data = self . _shlex_parse ( host_data ) host = self . _get_or_create_host ( host_name , host_data ) group . add_host ( host ) host . add_group ( group )