Ansible actually has a feature that predates the jinja2 change that works exactly the same. We already have an AnsibleUndefined that performs the exact same functionality: https://github.com/ansible/ansible/blob/devel/lib/ansible/template/__init__.py#L274
This functionality has been in place since Ansible 2.8. Due to the above, you need to do nothing, and you already get this functionality in Ansible On Sun, Jul 12, 2020 at 4:43 AM Baeschtu <[email protected]> wrote: > According to the release notes of Jinja2 Version 2.11.0 (released on > 2020-01-27) there is a new class named "ChainableUndefined" to handle > undefined variables on multiple levels in Jinja2 templates. Currently, I > use a ansible task using the module "template" to render jinja2 templates. > However, I don't know how to pass this new "ChainableUndefined" class to > the parameter "undefined" in the Jinja2 environment via the ansible module. > > Does anyone know how to set the parameter "undefined" to > ChainableUndefined through the ansible "template" module? > Does the module "template" only support the "StrictUndefined" class, > currently? > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/55390a3d-6fe7-40f4-8fcb-c8b9a4fa4a88o%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/55390a3d-6fe7-40f4-8fcb-c8b9a4fa4a88o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Matt Martz @sivel sivel.net -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v9CTPswhess1OutxhQoBLxiaREdcPfEP0LGWyfZ62YDvQ%40mail.gmail.com.
