一键导入
ansible-test
Run ansible-test sanity on module/plugin changes from the project virtualenv. Run after modifying any file under plugins/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run ansible-test sanity on module/plugin changes from the project virtualenv. Run after modifying any file under plugins/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Lint roles and playbooks with ansible-lint from the project virtualenv. Run after every change under roles/.
Format Python plugin code with black from the project virtualenv. Run after every edit to a file under plugins/ so it matches the black version CI enforces.
Manage changelog fragments and CHANGELOG.rst with antsibull-changelog from the project virtualenv. Add a fragment per user-facing change; release consumes fragments to cut a version.
Build the collection tarball with ansible-galaxy from the project virtualenv. Local builds verify only; the tag-driven release workflow builds and publishes.
Run a role's molecule scenario from the project virtualenv. Scenarios hit real Cloudflare and double as the role's example playbook; run from the role directory.
Install pyenv and the project's pinned Python. Use before the virtualenv skill when the .python-version interpreter is missing.
| name | ansible-test |
| description | Run ansible-test sanity on module/plugin changes from the project virtualenv. Run after modifying any file under plugins/. |
Run sanity after any change under plugins/. It catches DOCUMENTATION/RETURN/EXAMPLES
drift, argspec mismatches, and import errors — the same suite CI runs. Also run black and
ruff.
Cheap checks from the primary checkout, before running sanity:
git diff --check
venv/bin/python -m compileall -q plugins
Sanity only runs from a real checkout of the collection at
ansible_collections/{{ namespace }}/{{ name }}/ (from galaxy.yml):
venv/ansible_collections/{{ namespace }}/{{ name }}.Create it once, if git worktree list / ls doesn't show it, as a detached worktree — it must
be detached since the branch is checked out in the primary tree:
git worktree add --detach venv/ansible_collections/{{ namespace }}/{{ name }}
A plain copy works too (sanity doesn't need git), but then sync the full tree, not just plugins/.
Sync your edits in (always --delete, so removed/renamed files don't linger), then run from
inside the checkout:
rsync -a --delete plugins/ venv/ansible_collections/{{ namespace }}/{{ name }}/plugins/
cd venv/ansible_collections/{{ namespace }}/{{ name }}
../../../bin/ansible-test sanity --python "$(cat .python-version)" plugins/modules/{{ file }}.py
--test validate-modules for just doc/argspec checks.0.virtualenv skill