Token导航 LogoToken导航TokenDH.com
运维和基础设施external-servicegithub未标认证来源可访问许可证需确认审计提醒

ansible-generator可靠的生成器

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

3,525

周安装

144

GitHub Stars

197

下载量

1,140
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ansible-generator(可靠的生成器)
来源仓库:https://github.com/akin-ozer/cc-devops-skills
仓库路径:skills/ansible-generator
安装命令:
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill ansible-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill ansible-generator

简介

用于辅助云资源、部署、容器、基础设施和运维自动化任务。

  • 适合检查配置、整理部署步骤、分析资源状态或生成排障思路。
  • 使用时需明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作。
  • 涉及删除资源、重启服务或修改网络配置时应先确认影响范围。
  • 安装前建议确认权限范围、维护状态及是否会触发联网或文件读写操作。

SKILL.md

Ansible Generator

Trigger Phrases

Use this skill when the request is to generate or scaffold Ansible content, for example:

  • "Create a playbook to deploy nginx with TLS."
  • "Generate an Ansible role for PostgreSQL backups."
  • "Write inventory files for prod and staging."
  • "Build reusable Ansible tasks for user provisioning."
  • "Initialize an Ansible project with ansible.cfg and requirements.yml."
  • "Give me a quick Ansible snippet to install Docker."

Do not use this skill as the primary workflow when the request is validation/debug-only (syntax errors, lint failures, Molecule/test failures). Use ansible-validator for those cases.

Deterministic Execution Flow

Run these stages in order. Do not skip a stage unless the Validation Exceptions Matrix explicitly allows it.

Stage 0: Classify Request Mode

Determine one mode first:

ModeTypical user intentDeliverable
full-generation"create/build/generate" a full playbook/role/inventory/project file setComplete file(s), production-ready
snippet-only"quick snippet/example" without full file contextFocused task/play snippet
docs-onlyexplanation, pattern comparison, or conceptual guidance onlyExplanatory content, optional examples

Stage 1: Collect Minimum Inputs

If details are missing, ask briefly. If the user does not provide them, proceed with safe defaults and state assumptions.

Resource typeRequired inputsSafe defaults if missing
Playbooktarget hosts, privilege (become), OS family, objectivehosts: all, become: false, OS-agnostic modules
Rolerole name, primary service/package, supported OSrole name from task domain, Debian + RedHat vars
Tasks fileoperation scope, required vars, execution contextstandalone reusable tasks with documented vars
Inventoryenvironments, host groups, hostnames/IPsproduction/staging groups with placeholders
Project configcollections/roles dependencies, lint policyminimal ansible.cfg, requirements.yml, .ansible-lint

Stage 2: Reference Extraction Checklist

Before drafting content, extract the following from local references/templates.

Required references

  • references/best-practices.md

- Extract: FQCN requirements, idempotency rules, naming, security expectations.

  • references/module-patterns.md

- Extract: correct module/parameter patterns for the exact task type.

Required templates by output type

  • Playbook: assets/templates/playbook/basic_playbook.yml
  • Role: assets/templates/role/ (including meta/argument_specs.yml and molecule/default/ for test scaffolding)
  • Inventory (INI): assets/templates/inventory/hosts
  • Inventory (YAML): assets/templates/inventory/hosts.yml
  • Project config: assets/templates/project/ansible.cfg, assets/templates/project/requirements.yml, assets/templates/project/.ansible-lint

Extraction checks

  • Identify every [PLACEHOLDER] that must be replaced.
  • Decide module selection priority (ansible.builtin.* first).
  • Capture at least one OS-appropriate package pattern when OS-specific behavior is needed.
  • Capture required prerequisites (collections, binaries, target assumptions).

Stage 3: Generate

Apply these generation standards:

  1. Use FQCN module names (ansible.builtin.* first choice).
  2. Keep tasks idempotent (state, creates/removes, changed_when when needed).
  3. Use descriptive verb-first task names.
  4. Use true/false booleans (not yes/no).
  5. Add no_log: true for sensitive values.
  6. Replace all placeholders before presenting output.
  7. Prefer ansible.builtin.dnf for RHEL 8+/CentOS 8+ (legacy yum only for older systems).

Stage 4: Validate (Default) or Apply Exception (Fallback)

Use the matrix below to keep validation deterministic and non-blocking.

Validation Exceptions Matrix

ScenarioDefault behaviorAllowed fallbackWhat to report
full-generationRun ansible-validator after generation and after each fix passIf validator/tools are unavailable, run manual static checks (YAML shape, placeholder scan, FQCN/idempotency/security review) and provide exact deferred validation commandsExplicitly list which checks ran, which were skipped, and why
snippet-onlySkip full validator by default; do inline sanity checksRun full validator only if user asks or snippet is promoted to full fileState that validation was limited because output is snippet-only
docs-onlyNo runtime validationNone neededState that no executable artifact was generated
Offline environment (no web/docs access)Continue with local references and templatesSkip external doc lookups; prefer builtin-module implementations; provide notes for later external verificationState offline constraint and impacted checks/lookups

Resource Generation Guidance

Playbooks

  • Use assets/templates/playbook/basic_playbook.yml as structure.
  • Include: header comments, pre_tasks/tasks/post_tasks as needed, handlers, tags.
  • Add health checks when service deployment/configuration is involved.

Roles

  • Build from assets/templates/role/ structure.
  • Keep defaults in defaults/main.yml; keep higher-priority role vars in vars/main.yml.
  • Include OS-specific vars (vars/Debian.yml, vars/RedHat.yml) when relevant.
  • Add meta/argument_specs.yml for variable validation.
  • Include molecule/default/ scaffold (from assets/templates/role/molecule/) for production-ready roles.

Task Files

  • Keep scope narrow and reusable.
  • Document required input variables in comments.
  • Use conditionals for environment/OS-sensitive operations.

Inventory

  • Build logical host groups and optional group hierarchies.
  • Use variable layering intentionally: group_vars/all.yml -> group -> host.
  • Default to INI format (hosts) for simple topologies; use YAML format (hosts.yml) when the user requests it or when the hierarchy is complex.

Project Configuration

  • Provide baseline ansible.cfg, requirements.yml, and .ansible-lint.
  • Keep defaults practical and editable.

Custom Modules and Collections

When the request depends on non-builtin modules/collections:

  1. Identify collection + module and required version sensitivity.
  2. Check local references/module-patterns.md first.
  3. If still unresolved and network/tools are available, query Context7:

- mcp__context7__resolve-library-id - mcp__context7__query-docs

  1. If Context7 is unavailable, use official Ansible docs / Ansible Galaxy pages.
  2. If external lookup is unavailable, provide a builtin fallback approach and state the limitation.

Always include collection installation guidance when collection modules are used.

Canonical Example Flows

Flow A: Full Generation (Playbook)

User prompt: "Create a playbook to deploy nginx with TLS on Ubuntu and RHEL."

  1. Classify as full-generation.
  2. Gather/confirm required inputs (hosts, cert paths, become, service name).
  3. Extract required references (best-practices.md, module-patterns.md) and playbook template.
  4. Generate complete playbook with OS conditionals (apt/dnf), handlers, validation for config templates.
  5. Run ansible-validator.
  6. Fix issues and rerun until checks pass (or apply matrix fallback if tooling unavailable).
  7. Present output with validation summary, usage command, and prerequisites.

Flow B: Quick Snippet (Task Block)

User prompt: "Give me a snippet to create a user and SSH key."

  1. Classify as snippet-only.
  2. Extract minimal module patterns for ansible.builtin.user and ansible.builtin.authorized_key.
  3. Generate concise snippet with FQCN, idempotency, and variable placeholders.
  4. Perform inline sanity checks (YAML shape, FQCN, obvious idempotency/security).
  5. Present snippet and note that full validator run was skipped due to snippet-only mode.

Output Requirements

For generated executable artifacts, use this response structure:

## Generated [Resource Type]: [Name]

**Validation Status:** [Passed / Partially validated / Skipped with reason]
- YAML syntax: [status]
- Ansible syntax: [status]
- Lint: [status]

**Summary:**
- [What was generated]
- [Key implementation choices]

**Assumptions:**
- [Defaults or inferred values]

**Usage:**

[Exact command(s)]


**Prerequisites:**

- [Collections, binaries, environment needs]

Done Criteria

This skill execution is complete only when all applicable items are true:

  • Trigger decision is explicit (full-generation, snippet-only, or docs-only).
  • Required references/templates were consulted for the selected artifact type.
  • Generated output has no unresolved placeholders.
  • Validation followed default behavior or a documented exception from the matrix.
  • Any skipped checks include a concrete reason and deferred command(s).
  • Final output includes summary, assumptions, usage, and prerequisites.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.51%
按下载量换算405

Claude

27.79%
按下载量换算317

Cursor

21.17%
按下载量换算241

Gemini CLI

9.8%
按下载量换算112

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills