Introduction

Ansible-core 2.21.5 was released on October 5, 2026, as a maintenance release following 2.21.4. This version does not introduce new features; it is a bugfix-only release that ships three targeted fixes affecting ansible-connection, the ansible-test sanity suite, and the dnf5 module. The full changelog is available in the CHANGELOG-v2.21.rst file, and the release itself is tagged at v2.21.5.

Whats New

Bugfixes

  • ansible-connection: ensures that the connection persistent directory has private permissions. This covers the corner case in which the preceding directories do not exist or do not have sufficiently private permissions, which could otherwise leave the persistent connection socket directory exposed.
  • ansible-test: the validate-modules sanity test no longer fails when a plugin documents an option with the secret key. That key is only honored starting with ansible-core 2.22, where it masks the option value in output; earlier versions ignore it but now accept it in the sanity test, so collection authors can document secret options while still testing against 2.21 and earlier.
  • dnf5 module: the module now sets the dnf destdir configuration option from download_dir when download_only is true, matching what the documentation already states. Previously, packages downloaded with download_only: true could end up in the wrong directory because destdir was not being populated from download_dir.

Release Artifacts

ArtifactSizeSHA256
ansible_core-2.21.5-py3-none-any.whl2,457,267 bytes08886f9f3e23d129aa98a01271c4a47833516e1cb7c737a246788cb474f41222
ansible_core-2.21.5.tar.gz3,395,026 bytes65bb3148c58ebb843cd5074004c805f404f152114d98476dd823324616c9c6cb

How to Test

Install or upgrade ansible-core to 2.21.5 in a virtual environment and verify the version string, then exercise the dnf5 fix on a system that has the module available.

# Create an isolated environment
python3 -m venv ansible-2215-test
source ansible-2215-test/bin/activate

# Install the exact version
pip install ansible-core==2.21.5

# Confirm the installed version
ansible --version

# Verify the downloaded wheel checksum (optional)
sha256sum ansible_core-2.21.5-py3-none-any.whl

# Quick sanity check on ansible-connection persistent dir permissions
ansible all -i localhost, -c local -m command -a "ls -ld ~/.ansible/pc"

# Test the dnf5 destdir fix (on a host with dnf5 installed)
ansible localhost -m dnf5 -a "name=httpd state=latest download_only=true download_dir=/tmp/dnf5-download"
ls -l /tmp/dnf5-download

Conclusion

Ansible-core 2.21.5 is a small, targeted bugfix release. Users relying on persistent connections, collection authors using the secret documentation key, or anyone using dnf5 with download_only should upgrade to pick up these fixes.