AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,400 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of 8 Ansible books published by Apress and Leanpub including "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example", and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Ansible Core 2.21.0b3: What's New in the Latest Beta (Preview Guide)

By Luca Berton · Published 2024-01-01 · Category: installation

Ansible-core 2.21.0b3 beta release overview. New features, improvements, upgrade considerations, and what to expect in the upcoming stable release.

Introduction

The Ansible community has released ansible-core 2.21.0b3, the third beta of the upcoming major release. This beta gives automation engineers a chance to test new features and provide feedback before the stable release.

Alongside this beta, the community also shipped maintenance releases for the current stable branches: ansible-core 2.20.5, 2.19.9, and 2.18.16.

See also: Ansible-Core March 2026 Releases: v2.16.18, v2.18.15, v2.19.8, and v2.20.4

Current Release Landscape

Understanding the ansible-core release branches helps you plan your upgrade path:

| Branch | Latest Version | Status | |--------|---------------|--------| | 2.21.x | 2.21.0b3 | Beta (pre-release) | | 2.20.x | 2.20.5 | Current stable | | 2.19.x | 2.19.9 | Maintenance | | 2.18.x | 2.18.16 | Extended maintenance |

Installing the Beta

Test the beta in a virtual environment to avoid impacting production:

# Create isolated test environment
- name: Set up ansible-core 2.21 beta test environment
  hosts: localhost
  connection: local
  tasks:
    - name: Create virtual environment
      ansible.builtin.command:
        cmd: python3 -m venv /opt/ansible-2.21-beta
        creates: /opt/ansible-2.21-beta/bin/activate

- name: Install ansible-core 2.21.0b3 ansible.builtin.pip: name: ansible-core==2.21.0b3 virtualenv: /opt/ansible-2.21-beta

- name: Verify installation ansible.builtin.command: cmd: /opt/ansible-2.21-beta/bin/ansible --version register: version_output

- name: Display version ansible.builtin.debug: var: version_output.stdout_lines

Or install manually:

python3 -m venv ~/ansible-2.21-test
source ~/ansible-2.21-test/bin/activate
pip install ansible-core==2.21.0b3
ansible --version

See also: Ansible 13 Upgrade Guide: Breaking Changes, Removals, and Migration Steps

Testing Your Existing Playbooks

Before upgrading to any new major version, test your existing automation:

- name: Validate playbook compatibility with ansible-core 2.21
  hosts: all
  gather_facts: true
  tasks:
    - name: Check ansible version
      ansible.builtin.debug:
        msg: "Running ansible-core {{ ansible_version.full }}"

- name: Test module functionality ansible.builtin.command: cmd: echo "Module test passed" register: test_result changed_when: false

- name: Verify Jinja2 filters ansible.builtin.set_fact: test_list: "{{ ['a', 'b', 'c'] | join(', ') }}" test_dict: "{{ {'key': 'value'} | to_nice_yaml }}"

- name: Report compatibility ansible.builtin.debug: msg: "All basic tests passed on ansible-core {{ ansible_version.full }}"

Maintenance Releases: What Was Fixed

ansible-core 2.20.5

The current stable release received bug fixes and security patches. If you're running 2.20.x in production, upgrade to 2.20.5:

pip install --upgrade ansible-core==2.20.5

ansible-core 2.19.9

For organizations still on the 2.19.x branch, this maintenance release includes important fixes:

pip install --upgrade ansible-core==2.19.9

ansible-core 2.18.16

Extended maintenance release for the 2.18.x branch:

pip install --upgrade ansible-core==2.18.16

See also: Ansible 14.0.0a3 Pre-Release: What's New in Ansible 14 (Preview)

Upgrade Planning Playbook

Use this playbook to plan your upgrade across environments:

- name: Ansible-core upgrade planning
  hosts: all
  gather_facts: true
  vars:
    target_version: "2.20.5"  # Current stable recommended
  tasks:
    - name: Get current ansible version
      ansible.builtin.command:
        cmd: ansible --version
      register: current_version
      changed_when: false
      ignore_errors: true

- name: Check Python version compatibility ansible.builtin.assert: that: - ansible_python_version is version('3.10', '>=') fail_msg: "ansible-core 2.21 requires Python 3.10+. Current: {{ ansible_python_version }}" success_msg: "Python {{ ansible_python_version }} is compatible"

- name: Check for deprecated module usage ansible.builtin.find: paths: /etc/ansible/playbooks patterns: "*.yml,*.yaml" contains: "include:" # Deprecated in favor of include_tasks recurse: true register: deprecated_usage

- name: Report deprecated patterns ansible.builtin.debug: msg: "Found {{ deprecated_usage.matched }} files using deprecated 'include:' — migrate to 'include_tasks:'" when: deprecated_usage.matched > 0

Best Practices for Beta Testing

Never run betas in production — use isolated test environments Test your most complex playbooks first — they're most likely to surface issues Report bugs upstream — beta feedback shapes the stable release Check the porting guide — review breaking changes before testing Use FQCN everywhereansible.builtin.command not command

FAQ

When will ansible-core 2.21 stable be released?

The beta phase typically lasts 4-8 weeks. Based on the b3 release in April 2026, expect stable around June-July 2026.

Should I upgrade from 2.20.x to 2.21 beta?

No. Stay on 2.20.5 stable for production. Only test 2.21 beta in isolated environments to prepare for the future upgrade.

What Python version does ansible-core 2.21 require?

Check the official documentation, but ansible-core has been progressively raising the minimum Python version. Expect Python 3.10+ for control nodes.

How do I report issues found during beta testing?

File issues on the ansible-core GitHub repository with detailed reproduction steps.

Conclusion

The ansible-core 2.21.0b3 release shows active development and continuous improvement of the Ansible automation engine. While you should stay on 2.20.5 for production workloads, testing the beta now helps you prepare for a smooth upgrade when stable lands.

Recommended action: Upgrade production to ansible-core 2.20.5 if you haven't already, and start beta testing 2.21 in isolated environments.

Related Articles

Ansible 13 to Ansible 14 Upgrade GuideHow to Install Ansible on Ubuntu 24.04Ansible Best Practices for Enterprise

Category: installation

Browse all Ansible tutorials · AnsiblePilot Home