ansible-expert
Expert-level Ansible for configuration management, automation, and infrastructure as code. Use when the user mentions automation, configuration management, infrastructure as code, playbooks, or roles, or when the task involves Ansible Architecture, Basic Inventory, YAML Inventory, or Dynamic Invento
By personamanagmentlayer · 508 installs
npx skills add personamanagmentlayer/pcl --skill ansible-expert
Source repository · Upstream listing
Ansible Expert
Expert guidance for Ansible configuration management, application deployment, and IT automation using declarative YAML playbooks.
Core Concepts
Ansible Architecture
Control node (runs Ansible)
Managed nodes (target systems)
Inventory (hosts and groups)
Playbooks (YAML automation scripts)
Modules (units of work)
Roles (reusable automation units)
Plugins (extend functionality)
Key Features
Agentless (SSH based)
Idempotent operations
Declarative syntax
Human readable YAML
Extensible with modules
Push based configuration
Parallel execution
Use Cases
Configuration management
Application deployment
Provisioning
Continuous delivery
Security automation
Orchestration
Installation
Inventory
Basic Inventory (INI format)
YAML Inventory
Dynamic Inventory
Templates (Jinja2)
Variables and Facts
Variable Precedence (low to high)
1. Role defaults
2. Inventory file/script group vars
3. Inventory group vars/all
4. Playbook group vars/all
5. Inventory group vars/\
6. Playbook group vars/\
7. Inventory file/script host vars
8. Inventory host vars/\
9. Playbook host vars/\
10. Host facts
11. Play vars
12. Play vars prompt
13. Play vars files
14. Role vars
15. Block vars
16. Task vars
17. Extra vars ( e flag)
Using Variables
Error Handling
Ansible Vault
Testing
Molecule (Role Testing)
Anti Patterns to Avoid
❌ Not using roles : Organize code in reusable roles
❌ Shell commands everywhere : Use modules when available
❌ Hardcoded values : Use variables
❌ No error handling : Use blocks, rescue, always
❌ Storing secrets in plaintext : Use Ansible Vault
❌ Not testing : Use molecule for role testing
❌ Ignoring idempotency : Tasks should be safe to run multiple times
❌ Complex playbooks : Break into smaller, focused playbooks
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
[Best Practices](references/BEST PRACTICES.md) — Playbook Organization, Idempotency, Performance, Security
[Playbooks](references/PLAYBOOKS.md) — Basic Playbook, Advanced Playbook, Conditionals and Loops
[Roles](references/ROLES.md) — Role Structure, Example Role, Role Dependencies
Resources
Ansible Documentation: https://docs.ansible.com/
Ansible Galaxy: https://galaxy.ansible.com/
Molecule: https://molecule.readthedocs.io/
Best Practices: https://docs.ansible.com/ansible/latest/user guide/playbooks best practices.html