File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
docs/docsite/rst/porting_guides Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,34 @@ Multi-pass Templating
341
341
Embedding templates within other templates or expressions can result in untrusted templates being executed.
342
342
The overhauled templating engine in this release no longer supports this insecure behavior.
343
343
344
+ Example - Unnecessary Template in Expression
345
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
346
+
347
+ This conditional references a variable using a template, instead of using the variable directly in the expression.
348
+
349
+ .. code-block :: yaml+jinja
350
+
351
+ - assert:
352
+ that: 1 + {{ value }} == 2
353
+ vars:
354
+ value: 1
355
+
356
+
357
+ The error reported is::
358
+
359
+ Syntax error in expression. Template delimiters are not supported in expressions: expected token ':', got '}'
360
+
361
+
362
+ This can be resolved by referencing the variable without a template:
363
+
364
+ .. code-block :: yaml+jinja
365
+
366
+ - assert:
367
+ that: 1 + value == 2
368
+ vars:
369
+ value: 1
370
+
371
+
344
372
Example - Dynamic Expression Construction
345
373
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
346
374
You can’t perform that action at this time.
0 commit comments