In an Ansible task I'd like to test if string is json prior to use it with from_json.
fatal: [localhost]: FAILED! =>
msg: |-
the field 'args' has an invalid value ({u'tojson': u'{{ notjson | from_json}}'}), and could not be converted to an dict.The error was: No JSON object could be decoded
Thanks in advance for your help.