creating-ansible-playbooks

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Ansible Playbook Creator

Ansible Playbook Creator

This skill provides automated assistance for ansible playbook creator tasks.
本技能为Ansible Playbook创建任务提供自动化辅助支持。

Prerequisites

前提条件

Before using this skill, ensure:
  • Required credentials and permissions for the operations
  • Understanding of the system architecture and dependencies
  • Backup of critical data before making structural changes
  • Access to relevant documentation and configuration files
  • Monitoring tools configured for observability
  • Development or staging environment available for testing
使用本技能前,请确保:
  • 具备操作所需的凭证与权限
  • 了解系统架构及依赖关系
  • 在进行结构性变更前备份关键数据
  • 可访问相关文档与配置文件
  • 已配置监控工具以实现可观测性
  • 有开发或预演环境可用于测试

Instructions

操作步骤

Step 1: Assess Current State

步骤1:评估当前状态

  1. Review current configuration, setup, and baseline metrics
  2. Identify specific requirements, goals, and constraints
  3. Document existing patterns, issues, and pain points
  4. Analyze dependencies and integration points
  5. Validate all prerequisites are met before proceeding
  1. 回顾当前配置、设置及基准指标
  2. 明确具体需求、目标与约束条件
  3. 记录现有模式、问题与痛点
  4. 分析依赖关系与集成点
  5. 在继续操作前确认所有前提条件均已满足

Step 2: Design Solution

步骤2:设计解决方案

  1. Define optimal approach based on best practices
  2. Create detailed implementation plan with clear steps
  3. Identify potential risks and mitigation strategies
  4. Document expected outcomes and success criteria
  5. Review plan with team or stakeholders if needed
  1. 基于最佳实践定义最优方案
  2. 创建包含清晰步骤的详细实施计划
  3. 识别潜在风险及缓解策略
  4. 记录预期成果与成功标准
  5. 如有需要,与团队或利益相关方审核计划

Step 3: Implement Changes

步骤3:实施变更

  1. Execute implementation in non-production environment first
  2. Verify changes work as expected with thorough testing
  3. Monitor for any issues, errors, or performance impacts
  4. Document all changes, decisions, and configurations
  5. Prepare rollback plan and recovery procedures
  1. 先在非生产环境中执行实施操作
  2. 通过全面测试验证变更是否符合预期
  3. 监控是否出现任何问题、错误或性能影响
  4. 记录所有变更、决策与配置信息
  5. 准备回滚计划与恢复流程

Step 4: Validate Implementation

步骤4:验证实施效果

  1. Run comprehensive tests to verify all functionality
  2. Compare performance metrics against baseline
  3. Confirm no unintended side effects or regressions
  4. Update all relevant documentation
  5. Obtain approval before production deployment
  1. 运行全面测试以验证所有功能
  2. 将性能指标与基准值进行对比
  3. 确认无意外副作用或回归问题
  4. 更新所有相关文档
  5. 在部署到生产环境前获得批准

Step 5: Deploy to Production

步骤5:部署到生产环境

  1. Schedule deployment during appropriate maintenance window
  2. Execute implementation with real-time monitoring
  3. Watch closely for any issues or anomalies
  4. Verify successful deployment and functionality
  5. Document completion, metrics, and lessons learned
  1. 在合适的维护窗口安排部署
  2. 执行实施操作并进行实时监控
  3. 密切关注是否出现任何问题或异常
  4. 验证部署成功且功能正常
  5. 记录完成情况、指标与经验教训

Output

输出内容

This skill produces:
Implementation Artifacts: Scripts, configuration files, code, and automation tools
Documentation: Comprehensive documentation of changes, procedures, and architecture
Test Results: Validation reports, test coverage, and quality metrics
Monitoring Configuration: Dashboards, alerts, metrics, and observability setup
Runbooks: Operational procedures for maintenance, troubleshooting, and incident response
本技能可生成以下成果:
实施工件:脚本、配置文件、代码及自动化工具
文档:关于变更、流程与架构的全面文档
测试结果:验证报告、测试覆盖率与质量指标
监控配置:仪表盘、告警、指标及可观测性设置
运行手册:用于维护、故障排查与事件响应的操作流程

Error Handling

错误处理

Permission and Access Issues:
  • Verify credentials and permissions for all operations
  • Request elevated access if required for specific tasks
  • Document all permission requirements for automation
  • Use separate service accounts for privileged operations
  • Implement least-privilege access principles
Connection and Network Failures:
  • Check network connectivity, firewalls, and security groups
  • Verify service endpoints, DNS resolution, and routing
  • Test connections using diagnostic and troubleshooting tools
  • Review network policies, ACLs, and security configurations
  • Implement retry logic with exponential backoff
Resource Constraints:
  • Monitor resource usage (CPU, memory, disk, network)
  • Implement throttling, rate limiting, or queue mechanisms
  • Schedule resource-intensive tasks during low-traffic periods
  • Scale infrastructure resources if consistently hitting limits
  • Optimize queries, code, or configurations for efficiency
Configuration and Syntax Errors:
  • Validate all configuration syntax before applying changes
  • Test configurations thoroughly in non-production first
  • Implement automated configuration validation checks
  • Maintain version control for all configuration files
  • Keep previous working configuration for quick rollback
权限与访问问题
  • 验证所有操作的凭证与权限
  • 如需特定任务权限,申请提升访问权限
  • 记录自动化所需的所有权限要求
  • 为特权操作使用独立的服务账户
  • 遵循最小权限访问原则
连接与网络故障
  • 检查网络连通性、防火墙与安全组
  • 验证服务端点、DNS解析与路由
  • 使用诊断与故障排查工具测试连接
  • 审查网络策略、ACL与安全配置
  • 实现带有指数退避的重试逻辑
资源约束问题
  • 监控资源使用情况(CPU、内存、磁盘、网络)
  • 实施限流、速率限制或队列机制
  • 在低流量时段安排资源密集型任务
  • 若持续达到资源限制,扩展基础设施资源
  • 优化查询、代码或配置以提升效率
配置与语法错误
  • 在应用变更前验证所有配置语法
  • 先在非生产环境中全面测试配置
  • 实施自动化配置验证检查
  • 对所有配置文件进行版本控制
  • 保留之前的可用配置以便快速回滚

Resources

资源

Configuration Templates:
{baseDir}/templates/ansible-playbook-creator/
Documentation and Guides:
{baseDir}/docs/ansible-playbook-creator/
Example Scripts and Code:
{baseDir}/examples/ansible-playbook-creator/
Troubleshooting Guide:
{baseDir}/docs/ansible-playbook-creator-troubleshooting.md
Best Practices:
{baseDir}/docs/ansible-playbook-creator-best-practices.md
Monitoring Setup:
{baseDir}/monitoring/ansible-playbook-creator-dashboard.json
配置模板
{baseDir}/templates/ansible-playbook-creator/
文档与指南
{baseDir}/docs/ansible-playbook-creator/
示例脚本与代码
{baseDir}/examples/ansible-playbook-creator/
故障排查指南
{baseDir}/docs/ansible-playbook-creator-troubleshooting.md
最佳实践
{baseDir}/docs/ansible-playbook-creator-best-practices.md
监控设置
{baseDir}/monitoring/ansible-playbook-creator-dashboard.json

Overview

概述

This skill provides automated assistance for the described functionality.
本技能为上述功能提供自动化辅助支持。

Examples

示例

Example usage patterns will be demonstrated in context.
将在上下文中演示示例使用模式。