界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
设计与创意 · SKILL.md

ansible

ansible

【设计与创意】Use when automating infrastructure with Ansible — playbook development (tasks, handlers, variables, templates, conditionals, loops), role design (Galaxy structure, defaults, dependencies), inventory management (static/dynamic, groups, host_vars/group_vars), collections (ansible.builtin, community, custom), Ansible Vault (encryption), AWX/Ansible Auto…

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: ansible description: Use when automating infrastructure with Ansible — playbook development (tasks, handlers, variables, templates, conditionals, loops), role design (Galaxy structure, defaults, dependencies), inventory management (static/dynamic, groups, host_vars/group_vars), collections (ansible.builtin, community, custom), Ansible Vault (encryption), AWX/Ansible Automation Platform (job templates, workflows, RBAC, surveys), module development, testing (Molecule, ansible-lint), and performance tuning (forks, pipelining, async). Part of the automation-* skill family.

Ansible Automation — Admin & Developer

Covers Ansible core (ansible-core 2.15+/2.16+/2.17+), collections ecosystem, AWX/Ansible Automation Platform, and testing. For target node configuration see: rhel-server-admin, ubuntu-server-admin, windows-powershell.


Reference Files

Detailed code examples, patterns, and configuration are in the reference files below. Read the relevant file when working on that area.

FileCovers
awx-security-performance-testing.mdAWX/Ansible Automation Platform (job templates, workflows, RBAC, surveys, API), security patterns (secret management, SSH hardening, lint rules), performance tuning (forks, pipelining, mitogen, fact caching), and testing (Molecule, ansible-lint, CI integration)
fundamentals-playbooks.mdinstallation, playbook structure, ad-hoc commands, ansible.cfg, connection types, tasks (core patterns, variables, conditionals, loops, blocks, error handling), handlers, includes vs imports
inventory-vault-advanced.mdinventory management (static/dynamic, group_vars/host_vars, patterns), Ansible Vault (encryption commands, vault IDs, rekeying), and advanced patterns (delegation, serial/rolling, async, custom modules, callback plugins, dynamic includes)
templates-roles-collections.mdJinja2 templates, file management modules, role design (Galaxy structure, defaults, dependencies), and collections (installing, using, creating custom collections)

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Using command/shell for package installsNot idempotent — reruns always show changed, no rollback, no version pinningUse ansible.builtin.dnf, ansible.builtin.apt, or platform-specific package modules
Hardcoding IPs and hostnames in playbooksBreaks when inventory changes, makes playbooks non-portableUse inventory variables, host_vars/group_vars, and dynamic inventory plugins
One massive playbook with no rolesBecomes unmaintainable past 200 lines, no reuse across projectsBreak into roles with Galaxy structure; one role = one concern
Storing vault password in the repoAnyone with repo access can decrypt all secretsUse --vault-password-file pointing to a file outside the repo, or integrate with external secret manager
Running playbooks without --check --diff first in productionUnexpected changes hit live systems with no previewAlways dry-run with --check --diff on production inventories before applying
Ignoring ansible-lint warningsLeads to deprecated syntax, bare module names, and missing changed_when — breaks on ansible-core upgradesRun ansible-lint in CI; treat warnings as errors for production playbooks

Related Skills

DomainSkill
RHEL server admin (targets)rhel-server-admin
Ubuntu server admin (targets)ubuntu-server-admin
Windows PowerShell (WinRM targets)windows-powershell
Docker containersdocker-admin
Database config on RHELrhel-databases
Database config on Ubuntuubuntu-databases
IBM MQ automationibm-mq
IBM WebSphere automationibm-websphere
Centrify/AD integrationlinux-centrify
BMC Control-M job schedulingcontrol-m
我的收藏