I am new to Anisble and I have been trying to get Anisble to take the output of a local json file and read it, store the information and then output the data. I think I was successful because it does output the data in the file. What I am having trouble with is getting just a specific piece of data to display so I know Anisble is parsing the right section of the json file so I can pass it to a variable in the playbook. I feel I have tried almost everything but with no success.
server]$ ansible-playbook test-json-output.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’
PLAY [Ansible connection] ************************************************************************************************************************************************************************************
PLAY [Read local Mailgun JSON file] **************************************************************************************************************************************************************************
TASK [Output specific JSON data] *****************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {“msg”: "Error in jmespath.search in json_query filter plugin:\n’dict object’ has no attribute ’
I am able to get the output.json to display but looking only to display the record type and priority from the json file then take that output to a variable in the playbook.