ansible
npx machina-cli add skill partme-ai/full-stack-skills/ansible --openclawFiles (1)
SKILL.md
652 B
When to use this skill
Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]
How to use this skill
[待完善:根据具体工具添加使用指南]
Best Practices
[待完善:根据具体工具添加最佳实践]
Keywords
[待完善:根据具体工具添加关键词]
Source
git clone https://github.com/partme-ai/full-stack-skills/blob/main/skills/ansible/SKILL.mdView on GitHub Overview
This skill provides comprehensive guidance for Ansible automation, covering core concepts such as playbooks, roles, inventory, and module usage. It helps users who ask about Ansible, need to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible.
How This Skill Works
Ansible uses YAML-based playbooks to describe the desired state of systems and executes tasks from a control node over SSH (or WinRM for Windows). This skill explains structuring tasks, organizing reusable roles, managing inventories, and leveraging modules to perform idempotent actions across managed hosts.
When to Use It
- When you want to automate IT tasks across multiple servers or environments
- When you need to create and maintain Ansible playbooks for deployment, configuration, or application setup
- When organizing automation with roles, inventories, and variables
- When you require guidance on selecting and using Ansible modules
- When integrating Ansible into CI/CD pipelines or scheduled automation workflows
Quick Start
- Step 1: Install Ansible on your control node (pip install ansible or your distro package)
- Step 2: Create an inventory file (e.g., inventory.ini) listing hosts and groups
- Step 3: Write a simple playbook (e.g., site.yml) and run: ansible-playbook site.yml
Best Practices
- Define a clear inventory and use group_vars to manage environment differences
- Modularize tasks with roles and keep playbooks lean and readable
- Aim for idempotent tasks and use check_mode for safe testing
- Use version control, ansible-lint, and Molecule for testing
- Document changes and pin module versions in a requirements-like file
Example Use Cases
- Automate package installation and service management on Ubuntu hosts using apt and systemd modules
- Configure a web server stack (Nginx, firewall, and TLS) with roles and a site.yml playbook
- Create centralized user accounts, SSH keys, and sudo privileges across servers
- Deploy a Python web app with a virtualenv, pip install, and systemd service
- Manage Windows servers with WinRM to install features and configure configurations
Frequently Asked Questions
Add this skill to your agents