From f17a55a181171d508d0d15b5156780f338e90acc Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Thu, 14 Nov 2019 15:36:05 +0100 Subject: [PATCH] Add advice how to prevent jinja2 warning (#60594) * Add advice how to prevent jinja2 warning ##### SUMMARY This addition helps users to demonstrate how to prevent `[WARNING]: when statements should not include jinja2 templating delimiters`. ##### ISSUE TYPE - Docs Pull Request +label: docsite_pr * Update playbooks_tests.rst * Update playbooks_tests.rst Refer to the advised FAQ about when to use `{{ }}`. --- docs/docsite/rst/user_guide/playbooks_tests.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/docsite/rst/user_guide/playbooks_tests.rst b/docs/docsite/rst/user_guide/playbooks_tests.rst index c54ee299626..b08159d32af 100644 --- a/docs/docsite/rst/user_guide/playbooks_tests.rst +++ b/docs/docsite/rst/user_guide/playbooks_tests.rst @@ -127,7 +127,16 @@ This test also accepts a 3rd parameter, ``strict`` which defines if strict versi {{ sample_version_var is version('1.0', operator='lt', strict=True) }} +When using ``version`` in a playbook or role, don't use ``{{ }}`` as described in the `FAQ `_:: + vars: + my_version: 1.2.3 + + tasks: + - debug: + msg: "my_version is higher than 1.0.0" + when: my_version is version('1.0.0', '>') + .. _math_tests: Set theory tests