Lesson 3 of 13 · 20m
ansible-core, Collections, and Execution Environments
Why the 2.10 packaging split moved your modules into collections, which Python floors changed in 2.17, and how pins and EE images make a run reproducible.
pip install ansible does not install Ansible the way it did in 2019. The command is the same; the artifact is not. Since the 2.10 reorganization, the ansible package on PyPI is a meta-package — a thin bundle pinning ansible-core (the engine plus ~80 ansible.builtin.* modules) plus a few dozen community collections (the community.general, ansible.posix, amazon.aws namespaces where everything else moved). The monolith is gone. The module you remember isn't.
The mechanics: ansible-core is the runtime — ansible-playbook, the executor, the built-ins. Collections are namespaced content packs (namespace.collection) that ship modules, plugins, roles, and docs as a unit, installed under ~/.ansible/collections/ or collections/ beside your playbooks. That's why firewalld: became ansible.posix.firewalld: and docker_container: lives in community.docker. Bare short names still resolve through a redirect table for now; ansible-lint's fqcn rule exists because the redirects are a compatibility shim, not a guarantee.
The breakages this already caused
This wasn't theoretical churn; it was a flag day the ecosystem is still digesting.
ec2:was replaced byamazon.aws.ec2_instance:— a rename and an API change; playbooks written for 2.9 fail on task one.apt_keywas deprecated asapt-keyitself went away upstream; the replacement isansible.builtin.deb822_repository, which writes/etc/apt/sources.list.d/*.sourcesinstead of the keyring file.- ansible-core 2.17 (May 2024) dropped Python 3.6 and 2.7 as managed-node interpreters — Python 3.7+ is the floor now. RHEL 8's
platform-pythonis 3.6, so out of the box, 2.17 can't even discover an interpreter on a stock RHEL 8 image (ansible/ansible#83357 — the bug report is a parade of "RHEL 8, Ubuntu 18.04, openSUSE 15 just stopped working"). Red Hat's own answer: RHEL 8.10 ships ansible-core 2.16 for its lifecycle. If your fleet has old targets,ansible_python_interpreteror an older core isn't an edge case — it's the plan. - Version numbering split: the
ansiblepackage andansible-coreversion independently. Ansible 12 tracks ansible-core 2.19 (2.19.0 shipped 2025-07-21); "we're on Ansible 11" tells a reviewer nothing about your actual engine.
The wrong mental model
"Upgrade Ansible and my playbooks keep working" was true for a decade and stopped being true in 2.10. The upgrade path now has two axes — core version and collection versions — and they break independently. A community.general minor release can rename a module parameter under a pinned engine. Treating collections as ambient (whatever pip or Galaxy hands you today) is how a routine Friday deploy starts failing on a parameter that didn't exist Thursday.
The fix is boring and total: pin everything, in files that live in the repo.
# requirements.yml — collection deps
collections:
- name: community.general
version: "10.1.0"
- name: ansible.posix
version: "2.0.0"
- name: amazon.aws
version: ">=9.0.0,<10.0.0"# requirements.txt — engine deps
ansible-core==2.18.1ansible-galaxy collection install -r requirements.yml + pip install -r requirements.txt reproduces the environment. If CI installs these, "works on my laptop" stops being an explanation.
Execution environments: the container answer
The same problem — "whose Python, whose collections, whose OS packages" — got an official containerized answer. An execution environment (EE) is an OCI image containing ansible-core, the pinned collections, their Python and system dependencies, and nothing else. ansible-builder produces one from a manifest:
# execution-environment.yml
version: 3
images:
base_image:
name: quay.io/fedora/fedora:latest
dependencies:
ansible_core:
package_pip: ansible-core==2.18.1
galaxy: requirements.yml
python: requirements.txt
system: bindep.txtansible-builder build -t acme-ee:1.0, then ansible-navigator run site.yml --eei acme-ee:1.0 --mode stdout runs the playbook inside the image. AWX and Automation Platform run every job template in an EE — the image tag is the environment contract. Whether you adopt EEs or not, the lesson is the same: the version matrix is yours to pin, or the ecosystem pins it for you at the worst time.
Field notes
ansible --versionreports the core version;ansible-galaxy collection listreports the content versions. You need both to reproduce a bug report.collections:keyword on a play shortens FQCNs (collections: [community.general]letshaproxy:resolve) — fine inside a role, lazy at playbook top level where you want grep-ability.- Installing the
ansiblemeta-package and pinningrequirements.ymlis belt-and-suspenders that mostly works; installing justansible-coreplus pinned collections is the lean path CI should take.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Self-Hosting Prometheus and Grafana: Infrastructure Monitoring That Actually Works
Build a production-grade monitoring stack with Prometheus and Grafana from scratch. Covers architecture, Docker Compose deployment, Node Exporter, alerting with Alertmanager, PromQL from basics to advanced, pre-built dashboards, and everything SudoSecurity uses to monitor its own infrastructure.
Zero Trust Everything: The Complete Guide to Self-Hosting Teleport for Secure Infrastructure Access
SudoSecurity runs Teleport internally for everything — admin panel access, secure database connections, Kubernetes, and zero-trust philosophy across our entire team. This is the complete technical guide to installing, configuring, and running your own self-hosted Teleport cluster from scratch.
PostgreSQL 19 Is Out. REPACK Kept My Writes Running. The Docker Upgrade Will Stop Your App.
PostgreSQL 19 shipped on November 19 with REPACK (CONCURRENTLY), which removes table bloat without blocking writes. I measured it against VACUUM FULL, ran the upgrade from 18, and checked what breaks for self-hosters: Docker tags that refuse to start, a config setting that stops the server, and...
AWS Emulator Puts AWS on Your Laptop. Keep Your IAM Tests Off It.
AWS released AWS Emulator on November 11, a free local server that answers AWS API calls on 127.0.0.1 with per-run keys and fresh certificates.