Ansible 2.16.0: Major Enhancements and Updates
By Luca Berton · Published 2024-01-01 · Category: installation
Ansible 2.16.0 introduces support for Python 3.12, new remote options, and improved CLI functionality.

Introduction
Ansible, the open-source automation platform, has released a new version with numerous enhancements, bug fixes, and security updates. Ansible has become a fundamental tool for managing IT infrastructure and applications, streamlining workflows, and maintaining infrastructure as code (IaC) principles.See also: Ansible Core 2.14.2 & Community 7.2.0: Latest Updates
Ansible 2.16
Let’s delve into the key changes introduced in this release:
Important Changes:
- Drop Python 3.5 support for module execution.
- Drop Python 3.9 support for the controller.
- Add Python 3.12 support.
- Preserve display context when proxying display over the queue.
- Update
TaskExecutorto not unnecessarily establish persistentansible-connectionwhen not needed.
Ansible Enhancements
- Collection Path
- Removed Support for Windows Server 2012 and 2012 R2 as Microsoft’s support end of life on October 10th, 2023.
- Remote Support
- Python 3.12 Support
- Improved Container Naming
- Improved Test Provisioning
--python 3.11 option, improving testing flexibility.
- Streamlined Code Coverage
- RHEL 8.8 and RHEL 9.2 Support
- Deprecated Features Removal
CLI Improvements
- Improved CLI Argument Parsing
- Default Transport
DEFAULT_TRANSPORT now defaults to ‘ssh,’ while the ‘smart’ option is deprecated due to the decreasing relevance of control persist in newer OpenSSH versions.
Porting Guide
- Python Type Hints
Display class, contributing to improved code readability and maintainability.
- Galaxy Collection Warning
GALAXY_COLLECTIONS_PATH_WARNING, allows disabling warnings in the ansible-galaxy collection install process when installing a collection to an unconfigured path.
- Default Python Interpreter
INTERPRETER_PYTHON_FALLBACK list, ensuring compatibility with the latest Python release.
- DateTime Functions
utcfromtimestamp and utcnow have been included in ansible.module_utils.compat.datetime to return fixed offset datetime objects, aiding in time management and conversions.
- Distribution Server Timeout
GALAXY_SERVER_TIMEOUT configuration option has been introduced for distribution servers, making it easier to manage distribution server timeouts effectively.
- Python Type Annotations
Documentation Enhancements
- Set Filters Clarification
intersect, difference, symmetric_difference, and union, now explicitly states that the returned list items are in arbitrary order, offering clarity to users.
- CleansingNodeVisitor Removal
CleansingNodeVisitor class and its usage have been removed due to templating changes that rendered it unnecessary, simplifying code and improving maintainability.
- Manifest File Changes
exclude and recursive-exclude for generated files, have been removed from the MANIFEST.in file, as they were found to be unnecessary. This streamlines the release process.
- Man Pages Generation
- Directory Relocation
docs and examples directories have been relocated to the Ansible Documentation repository, making documentation management more organized.
- Setuptools Version Requirement
Updates for Specific Platforms
- SMGL OS Family
ansible_service_mgr fact has been updated to include the init system for the SMGL OS family.
- Importlib Enhancements
importlib.resources.abc.TraversableResources is now used instead of the deprecated importlib.abc.TraversableResources.
- Package Data in setup.cfg
package_data option is now used instead of include_package_data in setup.cfg.
- GPG Check Enhancement
transaction.run method, is now used instead of manual calling, improving the integrity of the process.
Templar Updates
- Dict Constructor
Ansible-Galaxy Improvements
- Collection and Metadata Filtering
ansible-doc command now allows filtering the listing of collections and metadata dump by more than one collection, improving search and retrieval capabilities.
- Error Handling
- File Extraction Warning
Security Updates
- Symlink Prevention
Bug Fixes and Improvements
A range of bug fixes, enhancements, and improvements have been made, addressing issues related to handler notifications, symbolic modes, parsing multi-line Jinja2 blocks, module responses, and more. These updates contribute to a more stable and reliable Ansible experience.Known Issues
While this release comes with numerous enhancements and fixes, there are a few known issues, such as difficulties with installing roles containing Java inner classes and limitations in detecting f-string spacing issues with the pep8 sanity test on specific Python versions.Full Release Note
For a complete list of changes, consult the Ansible documentation and release notes for a comprehensive overview of what’s new and improved:- https://github.com/ansible/ansible/blob/v2.16.0/changelogs/CHANGELOG-v2.16.rst
Conclusion
In conclusion, this Ansible 2.16.0 release represents a significant step forward in enhancing automation capabilities, improving documentation, and addressing security and usability concerns. Users are encouraged to update to the latest version to benefit from these enhancements and bug fixes.See also: Ansible Core 2.14.3, 2.13.8 & Community 7.3.0: Updates
Related Articles
- collection versioning with Ansible Galaxy
- configuration files via Ansible template
- the Ansible environment variables reference
- Ansible for Windows Guide
- Ansible handlers guide
See also
Category: installation
Watch the video: Ansible 2.16.0: Major Enhancements and Updates — Video Tutorial