This section discusses the behavioral changes between ansible-core 2.12 and ansible-core 2.13.
It is intended to assist in updating your playbooks, plugins and other parts of your Ansible infrastructure so they will work with this version of Ansible.
We suggest you read this page along with ansible-core Changelog for 2.13 to understand what updates you may need to make.
This document is part of a collection on porting. The complete list of porting guides can be found at porting guides.
[1, 2]:- name: Prior to 2.13
debug:
msg: '[1] + {{ [2] }}'
- name: 2.13 and forward
debug:
msg: '{{ [1] + [2] }}'
__repr__ method of an undefined variable represented by the AnsibleUndefined object changed. {{ '%r'|format(undefined_variable) }} returns AnsibleUndefined(hint=None, obj=missing, name='undefined_variable') in 2.13 as opposed to just AnsibleUndefined in versions 2.12 and prior.finalize method is no longer exposed in the globals for use in templating. To convert None to an empty string the following expression can be used: {{ value if value is not none }}.No notable changes
No notable changes
ansible.module_utils.basic will not function with lower Python versions.The following modules no longer exist:
No notable changes
No notable changes
ansible.module_utils.urls.fetch_url will now return the captured HTTPError exception as r. HTTPError is a response like object that can offer more information to module authors. Modules should rely on info['status'] >= 400 to determine if there was a failure, instead of using r is None or catching AttributeError when attempting r.read().No notable changes
No notable changes
No notable changes
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_core_2.13.html