Agent skill

ansible

Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible.

Stars 254
Forks 41

Install this agent skill to your Project

npx add-skill https://github.com/partme-ai/full-stack-skills/tree/main/skills/devops-skills/ansible

SKILL.md

When to use this skill

Use this skill whenever the user wants to:

  • Write Ansible playbooks, roles, or inventory files
  • Execute ad-hoc commands or run playbooks against hosts
  • Use modules (package, copy, template, service, user, etc.) for configuration and deployment
  • Handle variables, conditionals, loops, and error handling in Ansible
  • Set up Ansible Vault for secrets management

How to use this skill

Workflow

  1. Define inventory — list target hosts in INI or YAML format
  2. Write playbook — define hosts, tasks, handlers, and vars in YAML
  3. Organize with roles — extract reusable tasks, templates, and defaults into roles
  4. Run and validate — execute with ansible-playbook and verify idempotency

Quick Start Example

yaml
# site.yml
---
- name: Deploy web application
  hosts: webservers
  become: true
  vars:
    app_port: 8080
  tasks:
    - name: Install nginx
      ansible.builtin.package:
        name: nginx
        state: present

    - name: Deploy config from template
      ansible.builtin.template:
        src: templates/nginx.conf.j2
        dest: /etc/nginx/nginx.conf
      notify: restart nginx

  handlers:
    - name: restart nginx
      ansible.builtin.service:
        name: nginx
        state: restarted
bash
# Run the playbook
ansible-playbook -i inventory/production site.yml

# Ad-hoc ping all hosts
ansible -m ping all

Key Commands

Command Purpose
ansible-playbook playbook.yml Run a playbook
ansible -m ping all Test connectivity
ansible-vault encrypt vars/secrets.yml Encrypt sensitive data
ansible-galaxy init myrole Scaffold a new role

Best Practices

  • Organize with roles and group_vars/host_vars hierarchy; avoid monolithic playbooks
  • Encrypt sensitive data with ansible-vault; use idempotent tasks with state and conditionals
  • Define explicit failure handling (ignore_errors, block/rescue); use tags for selective runs
  • Control node requires Python; target hosts need SSH access; optionally use AWX/Tower for scheduling

Troubleshooting

  • Connection refused: Verify SSH keys and ansible_user in inventory
  • Module not found: Check Ansible version and use FQCN (e.g., ansible.builtin.copy)
  • Idempotency failures: Ensure tasks use state parameter and avoid shell commands where modules exist

Keywords

ansible, playbook, role, inventory, automation, configuration management, ansible-vault, infrastructure

Expand your agent's capabilities with these related and highly-rated skills.

partme-ai/full-stack-skills

ocrmypdf-batch

OCRmyPDF batch processing skill — process multiple PDFs, Docker automation, shell scripting, and CI/CD integration. Use when the user needs to OCR many PDFs, set up automated OCR pipelines, or integrate OCR into workflows.

254 41
Explore
partme-ai/full-stack-skills

ocrmypdf-optimize

OCRmyPDF optimization skill — compress PDFs, configure PDF/A output, JBIG2 encoding, and lossless optimization. Use when the user needs to reduce PDF file size, create archival PDF/A files, or optimize OCR output.

254 41
Explore
partme-ai/full-stack-skills

ocrmypdf-image

OCRmyPDF image processing skill — deskew, rotate, clean, despeckle, remove border from scanned documents. Use when the user needs to improve scanned PDF quality, fix skewed pages, remove noise, or clean up scanned documents before OCR.

254 41
Explore
partme-ai/full-stack-skills

ocrmypdf-api

OCRmyPDF Python API and plugin skill — use OCRmyPDF programmatically from Python, integrate with applications, and extend with plugins (EasyOCR, PaddleOCR, AppleOCR). Use when the user needs to call OCRmyPDF from Python code, build OCR pipelines, or use alternative OCR engines.

254 41
Explore
partme-ai/full-stack-skills

ocrmypdf

OCRmyPDF core skill — add searchable OCR text layer to scanned PDFs, convert images to searchable PDFs, support 100+ languages via Tesseract. Use when the user needs to OCR a PDF, make a scanned PDF searchable, or extract text from scanned documents.

254 41
Explore
partme-ai/full-stack-skills

svelte

Guides Svelte and SvelteKit development including reactive components, stores, transitions, lifecycle hooks, SSR, file-based routing, and deployment. Use when the user needs to build Svelte components, create SvelteKit applications, implement reactivity patterns, or configure Svelte with Vite.

254 41
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results