# Undef keyword/function documentation

**URL:** <https://forum.ansible.com/t/undef-keyword-function-documentation/2800>\
**Category:** Project Discussions\
**Tags:** documentation, ansible-core\
**Created:** [December 7, 2023, 10:51pm UTC](https://forum.ansible.com/t/undef-keyword-function-documentation/2800 "2023-12-07T22:51:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheSpy0](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thespy0/32/496_2.png) [@TheSpy0](https://forum.ansible.com/u/TheSpy0)\
**Post date:** [December 7, 2023, 10:51pm UTC](https://forum.ansible.com/t/undef-keyword-function-documentation/2800/1 "2023-12-07T22:51:36Z")

</div>

Maybe, I’m overthinking this, but while perusing the Ansible documentation I discovered `undef` in [filters section](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html#defining-mandatory-values). There is an example of how to use, and a reference to it in the [Ansible 2.8 Porting Guide](https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_core_2.12.html), but haven’t found any more details on it. Is it something that is built into Ansible? Does it come from Python or Jinja2?

The optional hint option (wouldn’t have known it was optional until reading the porting guide) seems useful to provide information to a user one what variable is undefined in playbooks, etc.

Maybe it’s not very important, but it would be nice to have some more discoverable documentation for this and any other lesser-known functions in Ansible, even if it’s just a link to another site in the case of Python or Jinja2 stuff.

Thanks.

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [December 8, 2023, 5:17pm UTC](https://forum.ansible.com/t/undef-keyword-function-documentation/2800/2 "2023-12-08T17:17:43Z")

</div>

It’s a custom function Ansible adds to the global Jinja2 environment. I opened a PR to try to improve the documentation [Add documentation for the custom Jinja2 global function `undef` by s-hertel · Pull Request #953 · ansible/ansible-documentation · GitHub](https://github.com/ansible/ansible-documentation/pull/953), any suggestions welcome.

---

<div class="post-metadata">

**Author:** ![TheSpy0](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thespy0/32/496_2.png) [@TheSpy0](https://forum.ansible.com/u/TheSpy0)\
**Post date:** [December 11, 2023, 2:24pm UTC](https://forum.ansible.com/t/undef-keyword-function-documentation/2800/3 "2023-12-11T14:24:49Z")

</div>

Thanks for the information and submitting that PR, @shertel .
