‹ 首页

ansible-automation

@aj-geddes · 收录于 5 天前 · 上游提交 4 个月前

Infrastructure automation and configuration management using Ansible playbooks, roles, and inventory. Use for deploying applications, patching, and managing servers.

适合你,如果你需要批量管理服务器或自动化部署流程

/ 通过 npx 安装 校验哈希
npx oh-my-skill add aj-geddes/useful-ai-prompts/ansible-automation
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- aj-geddes/useful-ai-prompts/ansible-automation
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify aj-geddes/useful-ai-prompts/ansible-automation
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
300GitHub stars
~418最小装载
~1.5K含声明引用
~1.7K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 3f5182c · 表述以原文为准
它做什么

装上后,Claude 能编写 Ansible 剧本(playbooks)来自动化多台服务器的配置、应用部署和系统更新。它生成角色(roles)、清单(inventory)等文件,实现基础设施即代码。

什么时候触发

当用户要求自动化服务器配置、部署应用、打补丁或管理基础设施时触发。也适用于多服务器编排、云实例配置、容器管理等场景。

装好后可以这样说
Claude会使用serial:1和健康检查确保零停机。
Claude会生成带变量和组的动态清单。
技能原文 SKILL.md作者撰写 · MIT · 3f5182c

Ansible Automation

Table of Contents
  • [Overview](#overview)
  • [When to Use](#when-to-use)
  • [Quick Start](#quick-start)
  • [Reference Guides](#reference-guides)
  • [Best Practices](#best-practices)
Overview

Automate infrastructure provisioning, configuration management, and application deployment across multiple servers using Ansible playbooks, roles, and dynamic inventory management.

When to Use
  • Configuration management
  • Application deployment
  • Infrastructure patching and updates
  • Multi-server orchestration
  • Cloud instance provisioning
  • Container management
  • Database administration
  • Security compliance automation
Quick Start

Minimal working example:

# site.yml - Main playbook
---
- name: Deploy application stack
  hosts: all
  gather_facts: yes
  serial: 1  # Rolling deployment

  pre_tasks:
    - name: Display host information
      debug:
        var: inventory_hostname
      tags: [always]

  roles:
    - common
    - docker
    - application

  post_tasks:
    - name: Verify deployment
      uri:
        url: "http://{{ inventory_hostname }}:8080/health"
        status_code: 200
      retries: 3
      delay: 10
// ... (see reference guides for full implementation)
Reference Guides

Detailed implementations in the references/ directory:

| Guide | Contents | |---|---| | [Playbook Structure and Best Practices](references/playbook-structure-and-best-practices.md) | Playbook Structure and Best Practices | | [Inventory and Variables](references/inventory-and-variables.md) | Inventory and Variables | | [Ansible Deployment Script](references/ansible-deployment-script.md) | Ansible Deployment Script | | [Configuration Template](references/configuration-template.md) | Configuration Template |

Best Practices
✅ DO
  • Use roles for modularity
  • Implement proper error handling
  • Use templates for configuration
  • Leverage handlers for idempotency
  • Use serial deployment for rolling updates
  • Implement health checks
  • Store inventory in version control
  • Use vault for sensitive data
❌ DON'T
  • Use command/shell without conditionals
  • Copy files without templates
  • Run without check mode first
  • Mix environments in inventory
  • Hardcode values
  • Ignore error handling
  • Use shell for simple tasks
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。