Build Your Own Bundle
Most users do not need to build: prebuilt bundles already cover 4 OSes x 2 architectures (see the Platform Matrix), so just download one. Build your own only when:
- you want a different Ansible version;
- you want to change the set of bundled collections.
Build steps
Prepare a build machine that meets all of these:
- It can reach the internet
- Its OS family, CPU architecture and Python version are the same as the offline target
Clone the primary repository and run the builder:
bash scripts/make-offline-bundle.sh- The result lands in
dist/:ansible-offline-install-2.0.0-bundle.tar.gzplus its.sha256checksum file. Copy it to the offline machine and follow steps 2 and 3 of the Quick Start.
🌏 The builder prints Chinese by default;
--lang enor theANSIBLE_OFFLINE_LANG=enenvironment variable switches it to English.
Options (environment variables)
| Variable | Effect |
|---|---|
WITH_COLLECTIONS=0 | Bundle Ansible only, without collections (smaller) |
PYTHON_BIN=python3.11 | Pick which Python builds the bundle (when several are installed). Without it, the script auto-detects the first interpreter >= 3.11 among python3.13 / 3.12 / 3.11 |
PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple | Use a domestic PyPI mirror when overseas networks are unreachable (Tsinghua shown; Aliyun works too) |
Separately: to change the Ansible version, edit the
ansible-corepin inrequirements.txtbefore building.
Bundled collections
- Bundles downloaded from Releases already contain
ansible.posixandcommunity.general(including their dependencies);install.shinstalls them automatically, nothing extra to do. collections-requirements.ymllists them; edit it and rebuild to change the set.- To skip collections at install time:
INSTALL_COLLECTIONS=0 bash install.sh.
Note: where collections come from
Collections are downloaded from Ansible Galaxy overseas and have no stable domestic mirror. If the build machine cannot reach Galaxy, this step fails - in that case use a ready-made bundle from Releases instead; the bundles already include the collections.
