def get_profile_index_and_values(config_file, profile_name):
    """Extract profile and its index from config file"""
    initial_profile = {'index': -1, 'profile': None}
    profiles = config_file.get('profiles')
    for index, profile in enumerate(profiles):
        if profile['name'] == profile_name:
            initial_profile['index'] = index
            initial_profile['profile'] = profile
    return initial_profile
