# Ansible-test validate-modules sanity test: report 'bad' return values that cannot be accessed with Jinja's dot notation

**URL:** <https://forum.ansible.com/t/ansible-test-validate-modules-sanity-test-report-bad-return-values-that-cannot-be-accessed-with-jinjas-dot-notation/44833>\
**Category:** Collection Development\
**Tags:** news-for-maintainers, module, ansible-test\
**Created:** [November 11, 2025, 9:14pm UTC](https://forum.ansible.com/t/ansible-test-validate-modules-sanity-test-report-bad-return-values-that-cannot-be-accessed-with-jinjas-dot-notation/44833 "2025-11-11T21:14:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 11, 2025, 9:14pm UTC](https://forum.ansible.com/t/ansible-test-validate-modules-sanity-test-report-bad-return-values-that-cannot-be-accessed-with-jinjas-dot-notation/44833/1 "2025-11-11T21:14:20Z")

</div>

If a module returns a return value `values` or `items` or `keys`, you cannot access it in playbooks and roles with Jinja’s dot notation since `result.values` will be the method of `dict`, which shadows the returned value.

validate-modules of ansible-core devel will now flag such return values with `bad-return-value-key` ([PR](https://github.com/ansible/ansible/pull/86079)). This can for example look like:

```auto
plugins/modules/ansible_galaxy_install.py:0:0: bad-return-value-key: Return value key '<path>' found in installed_collections should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/ansible_galaxy_install.py:0:0: bad-return-value-key: Return value key '<path>' found in installed_roles should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/gandi_livedns.py:0:0: bad-return-value-key: Return value key 'values' found in record should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/interfaces_file.py:0:0: bad-return-value-key: Return value key 'post-up' found in ifaces -> ifaces -> eth0 should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/interfaces_file.py:0:0: bad-return-value-key: Return value key 'pre-up' found in ifaces -> ifaces -> eth0 should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/keycloak_realm_info.py:0:0: bad-return-value-key: Return value key 'account-service' found in realm_info should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/keycloak_realm_info.py:0:0: bad-return-value-key: Return value key 'token-service' found in realm_info should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/keycloak_realm_info.py:0:0: bad-return-value-key: Return value key 'tokens-not-before' found in realm_info should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/keycloak_realm_keys_metadata_info.py:0:0: bad-return-value-key: Return value key 'keys' found in keys_metadata should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/nosh.py:0:0: bad-return-value-key: Return value key 'Required-By' found in status should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/nosh.py:0:0: bad-return-value-key: Return value key 'Stopped-By' found in status should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/nosh.py:0:0: bad-return-value-key: Return value key 'Wanted-By' found in status should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/omapi_host.py:0:0: bad-return-value-key: Return value key 'hardware-address' found in lease should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/omapi_host.py:0:0: bad-return-value-key: Return value key 'hardware-type' found in lease should not be used for return values since it cannot be accessed with dot notation in Jinja
plugins/modules/omapi_host.py:0:0: bad-return-value-key: Return value key 'ip-address' found in lease should not be used for return values since it cannot be accessed with dot notation in Jinja

```

You can add `validate-modules:bad-return-value-key` to `tests/sanity/ignore-2.21.txt` (and newer versions of the file) to ignore these potential problems.

I’d recommend to plan to rename these return values, by first adding a new name, and then (some time later) deprecate the old name. (You can use data tagging for that; [example of a helper module utils](https://github.com/ansible-collections/community.hrobot/blob/main/plugins/module_utils/_tagging.py) that gracefully handles older ansible-core versions.)
