I need to pass a variable in a json_query filter.
This example, with a fixed string, is working correctly (string=tutu) :
- set_fact:
my_value_exist: "{{ my_json.json | json_query('contains(component.name,`tutu`)')}}"
But i need to pass a variable , instead of tutu
- set_fact:
my_value_exist: "{{ my_json.json | json_query('contains(component.name,`{{my_var}}`)')}}"
{{my_var}} is a string retreived in a previous step
Do you have the correct syntax, so that the variable {{my_var}} could be passed correctly in parameter ?
Thanks for your help.
Regards,