votes up 4

You need to install "jmespath" prior to running json_query filter

Package:
ansible
github stars 49704
Exception Class:
AnsibleError

Raise code

on_query(data, expr):
    '''Query data using jmespath query language ( http://jmespath.org ). Example:
    - debug: msg="{{ instance | json_query(tagged_instances[*].block_device_mapping.*.volume_id') }}"
    '''
    if not HAS_LIB:
        raise AnsibleError('You need to install "jmespath" prior to running '
                           'json_query filter')

    try:
        return jmespath.search(expr, data)
    except jmespath.exceptions.JMESPathError as e:
        raise AnsibleFilterError('JMESPathError in json_query filter plugin:\n%s' % e)
    except Exception as e:
        
🙏 Scream for help to Ukraine
Today, 3rd July 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too! We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.

Ways to fix

votes up 1 votes down

This Exception just means that the Jmespath package is not installed, Ansible attempts to import it then stores if that worked as a boolean. meaning if the import fails the exception is raised. the way to fix this is to make sure that Jmespath is installed.

install using pip :

pip install jmespath

or with pip3:

pip3 install jmespath
Jun 23, 2021 huffnagledean answer

Add a possible fix

Please authorize to post fix