I’m really confused about a problem I’m having with a conditional statement in a playbook. The task is below:
- action: fail
when: “‘App: {{ app_id }}’ not in response.content”
When I run the playbook I get this error:
[WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: ‘Client: {{
wl_name }}’ not in response.content
As I suspected, when I removed the curly brackets the task failed because “App: app_id” was of course not in the output.
How then am I supposed to interpolate the variable app_id in this when condition?
Thanks,
Guy