--- id: ansible-runner version: "2.4.3" license: Apache Software License, Version 2.0 license_treatment: permissive maintenance: active --- # ansible-runner — "Consistent Ansible Python API and CLI with container and process isolation runtime capabilities" License: permissive · Maintenance: active · Downloads: 3.1M/mo ## What it is and what it does Ansible Runner is a Python library and command-line tool that abstracts direct interaction with Ansible, letting you run playbooks and ad-hoc commands from Python code or shell scripts with a consistent, stable interface. It handles process isolation and can work with container runtimes, making it useful for embedding Ansible automation into larger systems without tight coupling to Ansible's internal APIs. The package depends on pexpect for process interaction, python-daemon for background execution, pyyaml for configuration parsing, and packaging for version handling. It targets developers, system administrators, and IT teams who need to integrate Ansible automation into applications or orchestration workflows. The library is production-stable and actively maintained, supporting Python 3.9 through 3.12. Use it for: - Embed Ansible playbook execution into a Python application or REST API without direct Ansible API calls. - Run infrastructure automation tasks from a CI/CD pipeline with isolated process execution and consistent status reporting. - Build a custom orchestration layer that coordinates multiple Ansible runs with container or process boundaries. - Automate system administration tasks from a Python script with structured output and error handling. - Execute Ansible playbooks in a containerized environment as part of a larger automation platform. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Ansible Runner provides a Python library and CLI tool that wraps Ansible execution, offering a stable interface to run playbooks and ad-hoc commands with process and container isolation. Yes. Ansible Runner is production-stable, actively maintained, and has low install friction. It solves a real problem—providing a clean Python interface to Ansible—and is well-suited for teams embedding Ansible into applications or orchestration systems. No known vulnerabilities. The permissive Apache 2.0 license poses no restriction. ## Install pip install ansible-runner uv add ansible-runner poetry add ansible-runner ## Installing ansible-runner Before you install: Low install friction with five runtime dependencies (pexpect, packaging, python-daemon, pyyaml, importlib-metadata). Actively maintained as of 2026-08-14 with regular releases; repository shows 1081 stars and is not archived. License in practice: Licensed under Apache Software License, Version 2.0 (permissive). No restrictions on commercial or private use; you may modify and distribute under the same license terms. Quickstart: pip install ansible-runner from ansible_runner import run r = run(private_data_dir='/tmp/demo', playbook='site.yml') print(r.status, r.rc) Requires Python 3.9 or later; Ansible itself must be installed separately for playbook execution. Verify before relying: - Whether the package handles Ansible version compatibility automatically or requires manual version management. - Performance characteristics when running large playbooks or many concurrent tasks. - Container runtime requirements and supported container backends beyond process isolation. ## Package facts - License: Apache Software License, Version 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ansible execution wrapper, run ansible playbooks programmatically, ansible python api, ansible process isolation, ansible container interface, ansible cli abstraction, ansible automation framework, infrastructure-automation, ansible-integration, process-isolation [View on SkillFed](https://skillfed.io/packages/ansible-runner) · [View on PyPI](https://pypi.org/project/ansible-runner/)