CICD-246 · Ansible installation
Encyclopedia · Ansible and configuration management · All snippets
Previous · CICD-245 · Next · CICD-247
1. Where it fits
- Placement CI bootstrap.
- Prerequisites controller with reviewed inventory, pinned Ansible collections and a non-production target.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
python -m venv .venv
.venv/bin/python -m pip install --require-hashes -r ansible-requirements.lock
.venv/bin/ansible --version3. How it works
The virtual environment isolates the controller toolchain. Installing from a hashed lock limits the set of packages and versions the CI job accepts.
4. Verify the result
Generate the lock with hashes upstream. Use the same virtual environment for all controller steps.
Validation syntax-validated (Bash parse). Status definitions.