Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计提醒

ansibleAnsible 自动化

Agent Skill

ansible 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

329

周安装

14

GitHub Stars

4

下载量

115
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/alphaonedev/openclaw-graph --skill ansible

简介

ansible 作为无代理自动化工具,通过 YAML playbook 配置 IT 基础设施。

  • 适用于服务器 provisioning、跨主机配置管理及应用部署流水线。
  • 支持幂等操作,确保重复运行结果一致,依赖 SSH 协议通信。
  • 安装命令为 npx skills add https://github.com/alphaonedev/openclaw-graph --skill ansible。
  • 执行前应审核 playbook 内容,防止误操作影响线上服务。

SKILL.md

ansible

Purpose

Ansible is an open-source automation tool that configures IT infrastructure, deploys applications, and orchestrates tasks using agentless YAML playbooks. It ensures idempotent operations, meaning runs produce the same result regardless of initial state, and operates over SSH without installing agents on target hosts.

When to Use

Use Ansible for repeatable infrastructure tasks in DevOps pipelines, such as provisioning servers, managing configurations across fleets, or deploying apps in dynamic environments. Apply it when you need agentless automation, like updating software on remote machines, orchestrating multi-step workflows, or integrating with CI/CD tools, but avoid it for real-time monitoring where tools like Prometheus are better suited.

Key Capabilities

  • Agentless Execution: Connects via SSH or WinRM; specify hosts in inventory files (e.g., /etc/ansible/hosts) with formats like [web:children] for grouping.
  • Idempotent Playbooks: Write YAML files that define tasks; e.g., a task to install a package only if absent.
  • Modules and Roles: Use built-in modules like apt for package management; organize code into roles for reusability, stored in directories like roles/webserver/tasks/main.yml.
  • Variables and Templates: Define vars in YAML (e.g., {"http_port": 80}) and use Jinja2 templates for dynamic configs, like generating nginx.conf from a template.
  • Orchestration: Handle dependencies with plays that sequence tasks across hosts, ensuring ordered execution.

Usage Patterns

To automate tasks, create a playbook (e.g., site.yml) defining plays with hosts, tasks, and vars. Run it using ansible-playbook command. For dynamic inventories, use scripts that output JSON, like pulling from AWS EC2. Structure projects with an inventory file, group_vars for host-specific vars, and roles for modular code. Always test playbooks with --check flag first to simulate changes without applying them.

Common Commands/API

  • Run a Playbook: ansible-playbook site.yml --check --diff to simulate and show changes; add -l web to limit to a host group.
  • Ad Hoc Commands: ansible web -m ping to test connectivity; use -a "uptime" for arbitrary commands.
  • Manage Roles: ansible-galaxy install geerlingguy.apache to pull roles; build custom roles with ansible-galaxy init role_name.
  • Inventory and Vars: Set vars via -e "var1=value1" or environment vars like export ANSIBLE_HOST_KEY_CHECKING=False to bypass host key verification.
  • API Integration: Ansible's Python API via ansible_runner library; e.g., import ansible_runner and run interface.run(playbook='site.yml', extravars={'key': 'value'}) to execute programmatically. For authentication, use env vars like $ANSIBLE_PRIVATE_KEY_FILE=/path/to/key.pem for SSH keys or $ANSIBLE_BECOME_PASS for sudo passwords.

Integration Notes

Integrate Ansible with CI/CD tools like Jenkins by triggering playbooks via scripts; e.g., in a Jenkinsfile: sh 'ansible-playbook deploy.yml -e "env=prod"'. For cloud providers, use dynamic inventories; e.g., configure AWS with export AWS_ACCESS_KEY_ID=$AWS_KEY and run ansible-playbook -i ec2.py site.yml. Combine with Terraform by running Ansible post-provisioning; ensure vars are passed via files or env vars. Use version control: store playbooks in Git and pull them in pipelines.

Error Handling

In playbooks, use blocks with rescue and always clauses; e.g.:

- block:
    - debug: msg="Task succeeded"
  rescue:
    - debug: msg="Error occurred"
  always:
    - debug: msg="Cleanup step"

Check command exit codes; e.g., in scripts: ansible-playbook site.yml && echo "Success" || echo "Failed". For common issues, enable verbose output with -vvv to debug SSH connections or module failures. Use facts gathering to handle variable errors, and set ignore_errors: yes for non-critical tasks, but only when appropriate to avoid masking issues.

Concrete Usage Examples

  1. Deploy a Web Server on Ubuntu Hosts: Create a playbook (webserver.yml) with tasks to install Apache: - hosts: webservers tasks: - name: Install Apache apt: name: apache2 state: present Run it with: ansible-playbook webserver.yml -i inventory.txt --become to elevate privileges.
  2. Configure Multiple Hosts for NTP: Write a playbook (ntp_config.yml) to sync time: - hosts: all tasks: - name: Install NTP yum: name: ntp state: latest - name: Start NTP service service: name: ntpd state: started Execute: ansible-playbook ntp_config.yml -l ntp_hosts to target specific groups.

Graph Relationships

  • Related to: terraform (for infrastructure as code), kubernetes (for container orchestration), jenkins (for CI/CD integration), all within the devops-sre cluster.
  • Dependencies: Often pairs with vault for secret management.
  • Conflicts: Avoid with tools like Puppet if agent-based management is preferred.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.75%
按下载量换算40

Claude

28.68%
按下载量换算33

Cursor

18.1%
按下载量换算21

Gemini CLI

10.85%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills