You need to install "jmespath" prior to running json_query filter
Package:
ansible
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:
Links to the raise (1)
https://github.com/ansible/ansible/blob/015331518dff60f31a7d8ce24fc315e3ac9e86f8/test/support/integration/plugins/filter/json_query.py#L35Ways to fix
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
Add a possible fix
Please authorize to post fix