Ansible Version: Check, Upgrade & Compatibility Guide (2026)
By Luca Berton · Published 2024-01-01 · Category: installation
How to check your Ansible version, upgrade to the latest release, and understand version compatibility.
Ansible Version: Check, Upgrade & Compatibility Guide (2026)
Understanding Ansible versioning is essential for compatibility, upgrading, and troubleshooting. This guide covers how to check your version, the dual-versioning system, and how to upgrade.
See also: Ansible 13 Upgrade Guide: Breaking Changes, Removals, and Migration Steps
Check Your Ansible Version
# Full version info
ansible --version
# Output example:
# ansible [core 2.17.0]
# config file = /etc/ansible/ansible.cfg
# configured module search path = ['/home/user/.ansible/plugins/modules']
# ansible python module location = /usr/lib/python3/dist-packages/ansible
# jinja version = 3.1.4
# libyaml = True
# Just the version number
ansible --version | head -1
# ansible-core version
ansible-core --version 2>/dev/null || python3 -c "import ansible; print(ansible.__version__)"
# Community package version
ansible-community --version 2>/dev/null
Ansible Versioning: Two Packages
Since Ansible 2.10, there are two separate packages with different version numbers:
| Package | Current Version | Contains |
|---------|----------------|----------|
| ansible-core | 2.17.x | Core engine, built-in modules, CLI tools |
| ansible (community package) | 10.x | ansible-core + 85+ community collections |
Version Mapping
| ansible (community) | ansible-core | Python Required | |---------------------|-------------|-----------------| | 11.x | 2.18.x | 3.11+ | | 10.x | 2.17.x | 3.10+ | | 9.x | 2.16.x | 3.10+ | | 8.x | 2.15.x | 3.9+ | | 7.x | 2.14.x | 3.9+ |
See also: Ansible 14.0.0a3 Pre-Release: What's New in Ansible 14 (Preview)
Upgrade Ansible
pip
# Upgrade to latest
pip install --upgrade ansible
# Upgrade ansible-core only
pip install --upgrade ansible-core
# Upgrade to specific version
pip install ansible==10.5.0
pip install ansible-core==2.17.5
pipx
pipx upgrade ansible
apt (Ubuntu/Debian)
sudo apt update
sudo apt upgrade ansible
dnf (RHEL/Fedora)
sudo dnf upgrade ansible-core
Homebrew (macOS)
brew upgrade ansible
Check Version in Playbooks
- name: Check Ansible version compatibility
hosts: localhost
tasks:
- name: Display Ansible version
ansible.builtin.debug:
msg: "Ansible {{ ansible_version.full }} ({{ ansible_version.major }}.{{ ansible_version.minor }}.{{ ansible_version.revision }})"
- name: Fail if Ansible is too old
ansible.builtin.assert:
that:
- ansible_version.full is version('2.15', '>=')
fail_msg: "This playbook requires Ansible 2.15+. You have {{ ansible_version.full }}"
- name: Warn about deprecated version
ansible.builtin.debug:
msg: "WARNING: Ansible {{ ansible_version.full }} is approaching EOL"
when: ansible_version.full is version('2.16', '<')
See also: Ansible Core 2.21.0b3: What's New in the Latest Beta (Preview Guide)
Ansible Release Cycle
• Major releases: Every ~6 months (ansible-core 2.15 → 2.16 → 2.17) • Maintenance releases: Bug fixes for 2 most recent major versions • Security fixes: For current + 1 previous major version • EOL: ~1 year after releaseCurrent Support Status (2026)
| Version | Status | |---------|--------| | ansible-core 2.18 | Current (active development) | | ansible-core 2.17 | Maintained (bug fixes) | | ansible-core 2.16 | Security fixes only | | ansible-core 2.15 and older | End of Life |
Version-Specific Features
ansible-core 2.17 (2024)
• Python 3.10+ required on controller • Improvedansible-galaxy performance
• New ansible.builtin.include_role options
ansible-core 2.16 (2023)
• Python 3.10+ required on controller • Ansible lint integration improvements • Enhanced error messagesMultiple Versions Side by Side
Use virtual environments for version isolation:
# Version A
python3 -m venv ~/ansible-2.16
source ~/ansible-2.16/bin/activate
pip install ansible-core==2.16.0
# Version B
python3 -m venv ~/ansible-2.17
source ~/ansible-2.17/bin/activate
pip install ansible-core==2.17.0
# Switch versions by activating different venvs
source ~/ansible-2.17/bin/activate
ansible --version
FAQ
What is the latest Ansible version?
As of 2026, the latest ansible-core is 2.18.x and the latest ansible community package is 11.x. Check the Ansible releases page for the most current version.
What is the difference between ansible and ansible-core versions?
ansible-core (2.17.x) is the engine with built-in modules. ansible (10.x) is the community package that bundles ansible-core with 85+ collections. They have different version numbers but are released together.
How do I check which ansible-core version I have?
Run ansible --version — it shows ansible [core 2.17.x] on the first line. Or run python3 -c "import ansible; print(ansible.__version__)".
How long is each Ansible version supported?
Each ansible-core major version receives bug fixes for ~12 months and security fixes for ~18 months. Only the 2 most recent major versions are actively maintained.
Can I run multiple Ansible versions on the same machine?
Yes. Use Python virtual environments (python3 -m venv) to install different versions in isolation. Activate the desired environment before running ansible commands.
Conclusion
Check your Ansible version with ansible --version, understand the dual-package system (ansible vs ansible-core), and keep your installation updated for security fixes and new features. Use virtual environments when you need multiple versions.
Related Articles
• Install Ansible: Complete Guide for Every OS • What's New in Ansible • Ansible Release Lifecycle & SupportCategory: installation