Agent skill · software engineering · jeremylongshore
creating-ansible-playbooks
Execute use when you need to work with Ansible automation.
Why this skill is useful
Adds detailed guidance for creating Ansible playbooks, including specific error handling and best practices that the AI wouldn't reliably generate on its own.
What it needs
Requires ansible, ansible-lint installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Creating Ansible Playbooks Overview Generate production-ready Ansible playbooks, roles, and inventories for infrastructure automation. Supports provisioning servers, deploying applications, configuring services, and enforcing desired state across fleets of machines using SSH-based agentless automation. Prerequisites Ansible 2.14+ installed (ansible --version) SSH access to target hosts with key-based authentication Python 3.9+ on control node and managed nodes Inventory of target hosts (IPs or hostnames) Privilege escalation credentials (sudo) if configuring system-level resources ansible-lint installed for playbook validation Instructions 1. Scan the project for existing Ansible files (ansible.cfg, inventory/, roles/, groupvars/) to understand current structure 2. Determine the automation target: server provisioning, application deployment, configuration management, or security hardening 3. Create the playbook YAML with proper structure: hosts, become, vars, tasks, handlers 4. Extract reusable logic into roles using the standard directory layout (tasks/, handlers/, templates/, defaults/, vars/, meta/) 5. Define variables in groupvars/ and hostvars/ for environment-specific values, keeping secrets in vault-encrypted files 6. Use Jinja2 templates for configuration files that vary across environments 7. Add handlers for service restarts triggered by configuration changes 8. Validate the playbook with ansible-lint and ansible-playbook --check --diff (dry run) 9. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/creating-ansible-playbooks