# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper 安装 ansible

查看 ansible 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:ansible
```

## 代理安全回答

ansible automates hosts and infrastructure from local inventories and credentials.

- **凭据访问:** Reads SSH keys, vault files, inventories, cloud credentials, and environment variables.
- **远程变更:** Can configure remote hosts, cloud resources, and application deployments.
- **发布/制品风险:** Can roll out generated config, binaries, and service changes.
- **推荐控制:** Gate playbook runs, vault decrypts, and inventory changes.
- **代理使用指南:** Allow syntax checks and dry runs; require approval for playbook execution against real targets.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ansible
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ansible
```

  证据: MacPorts ports tree: sysutils/ansible/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add ansible
```

  证据: Alpine Linux edge package indexes: ansible from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install ansible
```

  证据: Debian stable package indexes: ansible from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install ansible
```

  证据: Fedora Rawhide package metadata: ansible from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#ansible
```

  证据: nixpkgs package indexes: ansible from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S ansible
```

  证据: Arch Linux sync databases: ansible from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install ansible
```

  证据: openSUSE Tumbleweed package metadata: ansible from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:ansible
- **软件包管理器:** Homebrew
- **版本:** 14.2.0
- **来源摘要:** Automate deployment, configuration, and upgrading
- **主页:** <https://www.ansible.com/>
- **仓库:** <https://github.com/ansible/ansible>
- **最后更新:** 2026-07-15T20:59:48Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- ansible (别名)
- ansible-community (别名)
- ansible-config (别名)
- ansible-console (别名)
- ansible-doc (别名)
- ansible-galaxy (别名)
- ansible-inventory (别名)
- ansible-playbook (别名)
- ansible-pull (别名)
- ansible-test (别名)
- ansible-vault (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 14.2.0
## 项目历史与用法

Ansible is a radically simple IT automation system for configuration management, application deployment, cloud provisioning, ad hoc task execution, network automation, and orchestration. Its package history matters because the name `ansible` shifted from the original all-in-one project to the modern community package layered on `ansible-core` and collections.

### 项目历史

Ansible was created as an agentless automation tool whose playbooks describe desired work in YAML and whose default transport avoids installing an agent on managed hosts. The current upstream source for the runtime is the ansible/ansible repository, while official documentation distinguishes the Ansible community package from `ansible-core`.

Red Hat announced an agreement to acquire Ansible in October 2015, framing it as an IT automation and DevOps platform that would complement Red Hat's management portfolio. That acquisition moved Ansible from a startup-backed open source project into Red Hat's broader automation product line while keeping the community project active.

The 2.10 era changed the packaging model. Official release documentation says the Ansible community package uses new versioning starting with 2.10 and then 3.0.0, while `ansible-core` continued the classic 2.x line. The community package includes the language, runtime, and selected collections; `ansible-core` contains the language, runtime, and builtin plugins.

### 采用历史

Ansible's adoption came from a practical systems-administration sweet spot: SSH-first orchestration, readable YAML playbooks, no managed-node daemon, and a large module ecosystem. It spread through Linux distributions, Python packaging, Homebrew, MacPorts, Nix, and enterprise Red Hat channels because it fits both laptop-driven automation and CI/CD infrastructure workflows.

The split into `ansible-core` plus collections made package selection more nuanced. Many community users still install the `ansible` package because it includes broad batteries: official docs say it offers the functionality that existed in Ansible 2.9, with more than 85 collections containing thousands of modules and plugins. Developers and minimalists often choose `ansible-core` and install only the collections they need.

As Ansible matured, adoption expanded beyond server configuration into network automation, cloud provisioning, security, Windows administration, and platform orchestration. Red Hat Ansible Automation Platform, Automation Hub, AWX, Galaxy, and a large collection ecosystem grew around the core CLI model.

### 使用方式

The Homebrew `ansible` formula installs the user-facing suite: `ansible`, `ansible-playbook`, `ansible-galaxy`, `ansible-doc`, `ansible-inventory`, `ansible-vault`, `ansible-config`, `ansible-console`, `ansible-pull`, and testing/community helpers. The everyday loop is inventory plus playbooks, with ad hoc commands for quick tasks and Galaxy for roles and collections.

Configuration is resolved from `$ANSIBLE_CONFIG`, `ansible.cfg` in the current directory, `~/.ansible.cfg`, then `/etc/ansible/ansible.cfg`; the first file found wins. Galaxy credentials can be provided through command-line API-key options or through the configured token path, whose default resolves from `ANSIBLE_HOME` to `~/.ansible/galaxy_token`.

Package users care about the distinction between `ansible --version` reporting an ansible-core version and the installed Python package named `ansible` representing the broader community package. That distinction explains why formula pinning, package-manager naming, and docs version matching can feel surprisingly non-obvious.

### 为什么软件包爱好者会关心

Ansible is one of the canonical infrastructure CLIs in package-manager culture: big enough to have versioned formulae, distro backports, Python package splits, and plugin/collection dependency concerns, but still shaped like command-line tools that can be scripted and vendored.

The package is also a case study in ecosystem packaging after modularization. `ansible-core` is the runtime center; `ansible` is the batteries-included community package; collections carry much of the domain-specific surface area; and tools like ansible-lint, ansible-creator, and ansible-language-server orbit the authoring workflow.

For users, the important packaging question is not just latest version but content set: does the install include the collections your playbooks expect, what Python versions are supported on control and target nodes, and which ansible-core line is underneath?

### 时间线

- 2013: PyPI release history shows Ansible 1.0.0 published in February 2013.
- 2015: Red Hat announces it will acquire Ansible.
- 2019: Ansible 2.9 is the last pre-collections-style all-in-one community release line.
- 2020: Ansible 2.10 introduces the community package model alongside ansible-base/ansible-core.
- 2021: Ansible 3.0.0 continues the community-package line based on ansible-base 2.10.x.
- 2026: Official docs list Ansible 13.x as current latest and Ansible 14.0.0 as in development.

### Related projects

- ansible-core is the runtime and language core that the `ansible` community package depends on.
- Ansible Galaxy and Automation Hub distribute roles and collections used by ansible-galaxy.
- AWX and Red Hat Ansible Automation Platform provide web UI, RBAC, scheduling, inventory, and enterprise automation around the CLI model.
- ansible-lint, ansible-creator, ansible-navigator, molecule, and Ansible Language Server are common companion tools for authoring and validating content.

### 来源

- <https://docs.ansible.com/projects/ansible/latest/index.html>
- <https://docs.ansible.com/projects/ansible/latest/reference_appendices/config.html>
- <https://docs.ansible.com/projects/ansible/latest/reference_appendices/release_and_maintenance.html>
- <https://github.com/ansible/ansible>
- <https://pypi.org/project/ansible/>
- <https://www.redhat.com/en/about/press-releases/red-hat-acquire-it-automation-and-devops-leader-ansible>


## 安全说明

没有找到 ansible 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: $ANSIBLE_CONFIG, ./ansible.cfg, ~/.ansible.cfg, /etc/ansible/ansible.cfg

## Credential files

- Unix: ~/.ansible/galaxy_token
## 其他软件包管理器记录

- Debian apt - ansible - 12.0.0+dfsg-0+deb13u1: normalized package name match | Debian stable package indexes: ansible from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Configuration management, deployment, and task execution system | https://github.com/ansible-community/ansible-build-data/
- Nix - ansible: normalized package name match | nixpkgs package indexes: ansible from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - ansible - 9.2.0+dfsg-0ubuntu5: normalized package name match | Ubuntu 24.04 LTS package indexes: ansible from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Configuration management, deployment, and task execution system | https://www.ansible.com
- apk - ansible - 14.2.0-r0: normalized package name match | Alpine Linux edge package indexes: ansible from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | core components for Ansible | https://ansible.com/
- apk - ansible-pyc - 14.2.0-r0: normalized package name match | Alpine Linux edge package indexes: ansible-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for ansible | https://ansible.com/
- dnf - ansible - 14.1.0-3.fc45: normalized package name match | Fedora Rawhide package metadata: ansible from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Curated set of Ansible collections included in addition to ansible-core | https://ansible.com
- pacman - ansible - 14.2.0-1: normalized package name match | Arch Linux sync databases: ansible from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Official assortment of Ansible collections | https://pypi.org/project/ansible/
- zypper - ansible - 14.2.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: ansible from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Radically simple IT automation | https://ansible.com/
- MacPorts - ansible: normalized package name match | MacPorts ports tree: sysutils/ansible/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- zypper - ansible-test - 2.21.2-1.1: installed executable or alias match | openSUSE Tumbleweed package metadata: ansible-test from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Tool for testing ansible plugin and module code | https://ansible.com/


## Combined YAML source

View the package source record on GitHub. [combined/ansible.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ansible.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
