SousChef
SousChef:多平台到 Ansible 迁移 + Ansible 升级规划
将 Chef、SaltStack、Puppet、PowerShell 和 Bash 自动化转换为 Ansible,并规划 Ansible 版本升级。通过 MCP(模型上下文协议)与任何 AI 助手配合使用——包括 Claude、GPT-4、GitHub Copilot、Red Hat AI、本地模型等。
快速概览: MIT 许可证 | Python 3.10+ | 95 个 MCP 工具 | 91% 测试覆盖率
警告 我并没有在两天内一边做本职工作(顺便提一下,那不是这个)一边手工编写 10 万行代码。其中很大一部分是由 AI 生成的。架构设计、手工编辑和个人担保确实是我做的,但这个仓库里到处都是 AI 的痕迹。
我已经在其中加入了大量测试,并且在推送前进行了严格的测试,但某些东西可能会损坏,或者可能一直就是坏的。如果你发现了问题,请提出来,我会修复它。
其中很大一部分依赖于模拟的 Chef/AWX/AAP API,因为令人震惊的是,我手头并没有一堆企业级安装和企业级数据来供我测试。买家请自负(鉴于你实际上什么都没买,所以要加倍小心)。
功能概述
Chef 到 Ansible 迁移 — 将 Cookbook、Recipe、自定义资源、Data Bag 和 Habitat 计划转换为 Ansible Playbook、角色和容器。支持基础设施、应用程序和日常运维。
SaltStack 到 Ansible 迁移 — 将 Salt State、Pillar 和 top.sls 目标转换为 Ansible 角色、变量文件、Ansible Vault 和 INI 清单。评估复杂性,生成分阶段迁移计划,并制作执行报告。
Puppet 到 Ansible 迁移 — 使用惯用的 ansible.builtin 模块将 Puppet 清单和模块目录转换为 Ansible Playbook。识别 14 种 Puppet 资源类型;将 10 种映射到 Ansible 模块,并为复杂结构提供 AI 辅助转换。
PowerShell 到 Ansible 迁移 — 将 Windows PowerShell 配置脚本转换为惯用的 ansible.windows Playbook、角色、WinRM 清单和 AWX/AAP 作业模板。
Bash 脚本迁移 — 将配置 Bash 脚本转换为带有质量评分、敏感数据检测和 AAP 就绪提示的 Ansible Playbook 和角色。
Ansible 升级规划 — 评估兼容性、规划版本升级、验证集合、识别重大变更并生成测试策略。
Related MCP server: AAP MCP Server
安装与设置
# Install from PyPI
pip install mcp-souschef
# Configure your MCP client (Claude Desktop example)
cp config/claude-desktop.json ~/Library/Application\ Support/Claude/claude_desktop_config.json
# Restart your AI assistant and start using
# Ask: "What migration tools are available?"其他 MCP 客户端: 请参阅 config/CONFIGURATION.md 以获取 VS Code Copilot、自定义设置和 Docker 部署的相关信息。
核心特性
95 个 MCP 工具,用于 Chef、SaltStack、Puppet、PowerShell、Bash 脚本迁移及 Ansible 升级
Web UI,具有交互式迁移规划器和可视化功能(包括 Salt、Puppet、PowerShell 和 Bash 选项卡)
CLI,用于自动化和 CI/CD 集成
生产就绪,具有 91% 的测试覆盖率和全面的验证
模型无关 — 可与任何支持 MCP 的 AI 助手配合使用
Chef Server 摄取,支持依赖关系闭包和离线包导出
常见用例
Chef 迁移:
将 Cookbook 转换为 Ansible Playbook 和角色
将 Chef Habitat 应用迁移到 Docker 容器
将 Data Bag 转换为 Ansible Vault
生成 AWX/AAP 作业模板和工作流
将 InSpec 测试转换为 Ansible 验证任务
通过
run_list或策略选择从 Chef Server 获取 Cookbook
SaltStack 迁移:
解析 SLS 状态文件并提取状态、Pillar 和 Grain 引用
将 Salt 状态转换为 Ansible Playbook 和角色任务文件
将 Pillar 数据迁移到 Ansible
group_vars/和 Ansible Vault根据
top.sls目标规则生成 Ansible 清单批量将完整的 Salt 状态树转换为 Ansible 角色结构
评估迁移复杂性并生成分阶段迁移计划
Puppet 迁移:
将 Puppet 清单 (
.pp) 和模块目录转换为 Ansible Playbook识别 14 种 Puppet 资源类型;将 10 种映射到惯用的
ansible.builtin模块(package,service,file,user,group,exec,cron,host,mount,ssh_authorized_key)对不支持的结构(Hiera 查找、导出资源、
create_resources)发出警告,并提供人工审查指导为无法自动映射的复杂 Puppet DSL 提供 AI 辅助转换
将单个 Puppet 资源声明转换为独立的 Ansible 任务
PowerShell 迁移:
将 Windows PowerShell 配置脚本转换为惯用的 Ansible Playbook
生成包含 WinRM 清单和
group_vars的完整 Ansible 角色将 28 种以上的 PowerShell 模式映射到
ansible.windows.*,community.windows.*,chocolatey.chocolatey.*生成带有 WinRM 凭据的 AWX/AAP Windows 作业模板
分析迁移保真度(0–100%)并提供可操作的建议
为所需的 Windows 集合创建完整的
requirements.yml
Bash 脚本迁移:
将配置 Bash 脚本转换为惯用的 Ansible Playbook
从 Bash 脚本生成完整的 Ansible 角色(任务、处理程序、默认值、元数据)
检测并标记硬编码的密钥,并提供
ansible-vault指导识别嵌入在 Bash 中的 CM 转义调用(Salt、Puppet、Chef)
获取 AAP 就绪的作业模板提示及执行环境建议
对迁移质量进行评分(A–F),并提供排名改进建议
Ansible 升级:
评估 Python 和 Ansible 版本兼容性
通过重大变更分析规划升级
验证集合兼容性
生成测试策略
跟踪生命周期结束 (EOL) 日期
基础设施与应用程序:
基础设施配置与设置
应用程序部署自动化
日常运维(备份、扩缩容、更新)
CI/CD 流水线迁移
多云自动化
命令行示例
# Chef migration
souschef-cli recipe /path/to/recipe.rb
souschef-cli template /path/to/template.erb
souschef-cli convert package nginx --action install
# SaltStack migration
souschef-cli salt assess /srv/salt/states/
souschef-cli salt convert /srv/salt/states/webserver/init.sls
souschef-cli salt inventory /srv/salt/top.sls
souschef-cli salt batch-convert /srv/salt/states/ --output-dir ./ansible-roles/
# PowerShell migration
souschef-cli powershell-parse scripts/setup.ps1
souschef-cli powershell-convert scripts/setup.ps1 --output playbook.yml
souschef-cli powershell-role scripts/setup.ps1 --output-dir ./ansible-role
# Puppet migration
souschef-cli puppet parse manifests/site.pp
souschef-cli puppet convert manifests/site.pp --output playbook.yml
souschef-cli puppet convert-module modules/myapp --output-dir ./ansible-role
# Bash script migration
souschef bash parse scripts/bootstrap.sh
souschef bash convert scripts/deploy.sh --output playbook.yml
souschef bash role scripts/setup.sh --role-name myapp --output-dir ./roles
# Ansible upgrades
souschef ansible assess --environment-path /path/to/ansible
souschef ansible plan --current 2.9 --target 2.17
souschef ansible validate-collections --requirements-file requirements.yml
# Web UI
souschef ui # Launch interactive dashboard文档
从这里开始
快速入门指南 — 5 分钟内上手
生产安全 — 在部署前验证迁移 ⚠️
用户指南 — 所有 95 个工具的详细说明及示例
Chef 迁移指南 — Chef 到 Ansible 的分步迁移流程
Salt 迁移指南 — SaltStack 到 Ansible 的分步迁移流程
Bash 迁移指南 — Bash 配置脚本的分步迁移流程
Puppet 迁移指南 — Puppet 到 Ansible 的转换
PowerShell 迁移指南 — PowerShell 到 Windows Ansible 的转换
Ansible 升级 — 版本升级规划工作流
参考
最近更新
v7.0.0 — 针对 SaltStack、Bash、PowerShell 和 Puppet 的一流多平台迁移文档
v6.0.0 — v2 核心基础,增强了迁移能力
v5.1.4 — 模块化架构,91% 测试覆盖率,完全类型安全,生产就绪
v5.0.0 — 完整的 Ansible 升级规划,包含版本矩阵和 EOL 跟踪
贡献
# Development setup
git clone https://github.com/kpeacocke/souschef.git && cd souschef
poetry install
poetry run pytest # Run tests
poetry run ruff check . # Lint
poetry run mypy souschef # Type check
# If you change terraform-provider/
cd terraform-provider
go test ./... # Run Go tests标准: 零警告策略,必须包含类型提示,90%+ 测试覆盖率,使用澳大利亚英语拼写。
请参阅 CONTRIBUTING.md 获取完整指南。
支持
问题: GitHub Issues
安全: 请参阅 SECURITY.md
许可证
MIT 许可证 — 详情请参阅 LICENSE。
Available Tools
34 toolsanalyze_chef_application_patternsC
Analyze Chef cookbook for application deployment patterns and provide migration recommendations.
Args: cookbook_path: Path to Chef application cookbook application_type: Type of application (web_application, microservice, database, etc.)
Returns: Analysis of deployment patterns with Ansible migration recommendations
Inputs: cookbook_path (required), application_type. Returns: result
analyze_chef_databag_usageA
Analyze Chef cookbook for data bag usage and provide migration recommendations.
Args: cookbook_path: Path to Chef cookbook databags_path: Optional path to data_bags directory for cross-reference
Returns: Analysis of data bag usage and migration recommendations
Inputs: cookbook_path (required), databags_path. Returns: result
analyze_chef_environment_usageC
Analyze Chef cookbook for environment usage and provide migration recommendations.
Args: cookbook_path: Path to Chef cookbook environments_path: Optional path to environments directory for cross-reference
Returns: Analysis of environment usage and migration recommendations
Inputs: cookbook_path (required), environments_path. Returns: result
analyze_chef_search_patternsC
Analyze Chef recipes/cookbooks to extract search patterns for inventory planning.
Args: recipe_or_cookbook_path: Path to Chef recipe file or cookbook directory.
Returns: JSON string with discovered search patterns and recommended inventory structure.
Inputs: recipe_or_cookbook_path (required). Returns: result
analyze_cookbook_dependenciesC
Analyze cookbook dependencies and identify migration order requirements.
Args: cookbook_path: Path to Chef cookbook or cookbooks directory dependency_depth: Analysis depth (direct, transitive, full)
Returns: Dependency analysis with migration order recommendations
Inputs: cookbook_path (required), dependency_depth. Returns: result
assess_chef_migration_complexityC
Assess the complexity of migrating Chef cookbooks to Ansible with detailed analysis.
Args: cookbook_paths: Comma-separated paths to Chef cookbooks or cookbook directory migration_scope: Scope of migration (full, recipes_only, infrastructure_only) target_platform: Target platform (ansible_awx, ansible_core, ansible_tower)
Returns: Comprehensive migration complexity assessment with recommendations
Inputs: cookbook_paths (required), migration_scope, target_platform. Returns: result
convert_chef_databag_to_varsB
Convert Chef data bag to Ansible variables format.
Args: databag_content: JSON content of the Chef data bag databag_name: Name of the data bag item_name: Name of the data bag item (default: "default") is_encrypted: Whether the data bag is encrypted target_scope: Variable scope ("group_vars", "host_vars", or "playbook")
Returns: Ansible variables YAML content or vault file structure
Inputs: databag_content (required), databag_name (required), item_name, is_encrypted, +1 more. Returns: result
convert_chef_deployment_to_ansible_strategyA
Convert Chef application deployment recipe to Ansible deployment strategy.
Args: deployment_recipe_path: Path to Chef deployment recipe deployment_pattern: Chef deployment pattern (blue_green, rolling, canary, auto_detect) target_strategy: Target Ansible strategy (rolling_update, blue_green, canary)
Returns: Ansible playbook with deployment strategy implementation
Inputs: deployment_recipe_path (required), deployment_pattern, target_strategy. Returns: result
convert_chef_environment_to_inventory_groupA
Convert Chef environment to Ansible inventory group with variables.
Args: environment_content: Ruby content of the Chef environment file environment_name: Name of the Chef environment include_constraints: Whether to include cookbook version constraints
Returns: Ansible inventory group configuration with variables
Inputs: environment_content (required), environment_name (required), include_constraints. Returns: result
convert_chef_search_to_inventoryA
Convert a Chef search query to Ansible inventory patterns and groups.
Args: search_query: Chef search query (e.g., "role:web AND environment:production").
Returns: JSON string with Ansible inventory patterns and group definitions.
Inputs: search_query (required). Returns: result
convert_inspec_to_testC
Convert InSpec controls to Ansible test format.
Args: inspec_path: Path to InSpec profile or control file. output_format: Output format ('testinfra' or 'ansible_assert').
Returns: Converted test code or error message.
Inputs: inspec_path (required), output_format. Returns: result
convert_resource_to_taskB
Convert a Chef resource to an Ansible task.
Args: resource_type: The Chef resource type (e.g., 'package', 'service'). resource_name: The name of the resource. action: The Chef action (e.g., 'install', 'start', 'create'). Defaults to 'create'. properties: Additional resource properties as a string representation.
Returns: YAML representation of the equivalent Ansible task.
Inputs: resource_type (required), resource_name (required), action, properties. Returns: result
generate_ansible_vault_from_databagsB
Generate Ansible Vault files from Chef data bags directory.
Args: databags_directory: Path to Chef data_bags directory output_directory: Target directory for Ansible variables (group_vars/host_vars) encryption_key_hint: Hint for identifying encrypted data bags
Returns: Summary of converted data bags and instructions
Inputs: databags_directory (required), output_directory, encryption_key_hint. Returns: result
generate_awx_inventory_source_from_chefB
Generate AWX/AAP inventory source from Chef server configuration.
Args: chef_server_url: Chef server URL for inventory sync organization: AWX organization name sync_schedule: Inventory sync schedule (hourly, daily, weekly)
Returns: AWX/AAP inventory source configuration for Chef server integration
Inputs: chef_server_url (required), organization, sync_schedule. Returns: result
generate_awx_job_template_from_cookbookB
Generate AWX/AAP job template configuration from Chef cookbook.
Args: cookbook_path: Path to Chef cookbook directory cookbook_name: Name of the cookbook for job template target_environment: Target environment for the job template include_survey: Whether to include survey spec for cookbook attributes
Returns: AWX/AAP job template JSON configuration
Inputs: cookbook_path (required), cookbook_name (required), target_environment, include_survey. Returns: result
generate_awx_project_from_cookbooksA
Generate AWX/AAP project configuration from Chef cookbooks directory.
Args: cookbooks_directory: Path to Chef cookbooks directory project_name: Name for the AWX project scm_type: SCM type (git, svn, etc.) scm_url: SCM repository URL
Returns: AWX/AAP project configuration with converted playbooks structure
Inputs: cookbooks_directory (required), project_name (required), scm_type, scm_url. Returns: result
generate_awx_workflow_from_chef_runlistC
Generate AWX/AAP workflow template from Chef runlist.
Args: runlist_content: Chef runlist content (JSON or comma-separated) workflow_name: Name for the workflow template environment: Target environment for workflow execution
Returns: AWX/AAP workflow template configuration with job dependencies
Inputs: runlist_content (required), workflow_name (required), environment. Returns: result
generate_blue_green_deployment_playbookB
Generate Ansible blue/green deployment playbook from application configuration.
Args: app_name: Name of the application to deploy service_config: JSON configuration for service setup health_check_url: URL endpoint for health checks
Returns: Complete blue/green deployment playbook with rollback capabilities
Inputs: app_name (required), service_config, health_check_url. Returns: result
generate_canary_deployment_strategyC
Generate Ansible canary deployment strategy with gradual rollout.
Args: app_name: Name of the application for canary deployment canary_percentage: Initial canary traffic percentage rollout_steps: Comma-separated rollout percentages
Returns: Canary deployment strategy with monitoring and automated rollback
Inputs: app_name (required), canary_percentage, rollout_steps. Returns: result
generate_dynamic_inventory_scriptA
Generate a Python dynamic inventory script from Chef search queries.
Args: search_queries: JSON string containing Chef search queries and group names.
Returns: Complete Python script for Ansible dynamic inventory.
Inputs: search_queries (required). Returns: result
generate_inspec_from_recipeA
Generate InSpec controls from a Chef recipe.
Args: recipe_path: Path to Chef recipe file.
Returns: InSpec control code or error message.
Inputs: recipe_path (required). Returns: result
generate_inventory_from_chef_environmentsB
Generate complete Ansible inventory from Chef environments directory.
Args: environments_directory: Path to Chef environments directory output_format: Output format ("yaml", "ini", or "both")
Returns: Complete Ansible inventory structure with environment-based groups
Inputs: environments_directory (required), output_format. Returns: result
generate_migration_planA
Generate a detailed migration plan from Chef to Ansible with timeline and milestones.
Args: cookbook_paths: Comma-separated paths to Chef cookbooks migration_strategy: Migration approach (big_bang, phased, parallel) timeline_weeks: Target timeline in weeks
Returns: Detailed migration plan with phases, milestones, and deliverables
Inputs: cookbook_paths (required), migration_strategy, timeline_weeks. Returns: result
generate_migration_reportC
Generate comprehensive migration report from assessment results.
Args: assessment_results: JSON string or summary of assessment results report_format: Report format (executive, technical, combined) include_technical_details: Include detailed technical analysis (yes/no)
Returns: Formatted migration report for stakeholders
Inputs: assessment_results (required), report_format, include_technical_details. Returns: result
generate_playbook_from_recipeA
Generate a complete Ansible playbook from a Chef recipe.
Args: recipe_path: Path to the Chef recipe (.rb) file.
Returns: Complete Ansible playbook in YAML format with tasks, handlers, and variables.
Inputs: recipe_path (required). Returns: result
list_cookbook_structureC
List the structure of a Chef cookbook directory.
Args: path: Path to the cookbook root directory.
Returns: Formatted string showing the cookbook structure.
Inputs: path (required). Returns: result
list_directoryC
List the contents of a directory.
Args: path: The path to the directory to list.
Returns: A list of filenames in the directory, or an error message.
Inputs: path (required). Returns: result
parse_attributesC
Parse a Chef attributes file and extract attribute definitions.
Args: path: Path to the attributes (.rb) file.
Returns: Formatted string with extracted attributes.
Inputs: path (required). Returns: result
parse_custom_resourceA
Parse a Chef custom resource or LWRP file.
Args: path: Path to the custom resource (.rb) file.
Returns: JSON string with extracted properties, actions, and metadata.
Inputs: path (required). Returns: result
parse_inspec_profileB
Parse an InSpec profile and extract controls.
Args: path: Path to InSpec profile directory or control file (.rb).
Returns: JSON string with parsed controls, or error message.
Inputs: path (required). Returns: result
parse_recipeB
Parse a Chef recipe file and extract resources.
Args: path: Path to the recipe (.rb) file.
Returns: Formatted string with extracted Chef resources and their properties.
Inputs: path (required). Returns: result
parse_templateA
Parse a Chef ERB template file and convert to Jinja2.
Args: path: Path to the ERB template file.
Returns: JSON string with extracted variables and Jinja2-converted template.
Inputs: path (required). Returns: result
read_cookbook_metadataC
Parse Chef cookbook metadata.rb file.
Args: path: Path to the metadata.rb file.
Returns: Formatted string with extracted metadata.
Inputs: path (required). Returns: result
read_fileC
Read the contents of a file.
Args: path: The path to the file to read.
Returns: The contents of the file, or an error message.
Inputs: path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 34 tools
The tools have clear purposes focused on Chef-to-Ansible migration, but significant overlap exists between analysis tools (e.g., analyze_chef_application_patterns, analyze_chef_databag_usage, analyze_chef_environment_usage) and conversion tools (e.g., convert_chef_databag_to_vars, convert_chef_environment_to_inventory_group). While descriptions help differentiate, an agent might struggle to choose between similar analysis or conversion tools for specific migration tasks, leading to potential misselection.
Most tools follow a consistent verb_noun pattern (e.g., analyze_chef_application_patterns, convert_chef_databag_to_vars, generate_ansible_vault_from_databags), which aids predictability. However, there are minor deviations like list_directory and read_file, which use simpler verbs without the domain prefix, slightly breaking the pattern but remaining readable overall.
With 34 tools, the count is excessive for the Chef-to-Ansible migration domain. Many tools could be consolidated (e.g., multiple analysis and conversion tools overlap in functionality), making the set feel heavy and overwhelming. A more streamlined set of 10-20 tools would better serve the purpose without sacrificing coverage.
The tool set provides comprehensive coverage for Chef-to-Ansible migration, including analysis, conversion, generation of Ansible components (playbooks, inventory, vaults), integration with AWX/AAP, deployment strategies, and reporting. It supports full CRUD/lifecycle operations for the domain, with no obvious gaps that would cause agent failures in migration workflows.
Maintenance
Related MCP Connectors
DORA OS Conductor — 16-tool meta-orchestrator for DORA compliance workflow automation.
30+ deterministic dev and delivery tools: linting, metrics, diagrams, model advice, AI-text checks.
Evidence-first architecture workbench: 48 deterministic tools, 10 architect personas, any cloud
Detects database migration table locks, terraform cost leaks, and OWASP API flaws.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables comprehensive Ansible automation management through natural language, including playbook creation and execution, inventory management, role scaffolding, and project workflows. Supports both local inventories and full project lifecycle management with syntax validation and idempotency testing.30-
- FlicenseCqualityDmaintenanceEnables comprehensive management of Ansible Automation Platform Controller and Gateway through 17 specialized tools covering job execution, inventory management, workflows, credentials, user administration, and system monitoring.18-
- AlicenseNot gradedqualityDmaintenance36 enterprise MCP tools for AWS security, infrastructure generation, AI workflows, and agent governance. IAM validation, MFA compliance, CloudFormation/SAM generation, DynamoDB design, OAuth validation, vector embeddings, error analysis, data lake readiness, 12 ACI governance tools for AI agent safety, and 4 local interview tools.58 npmMIT
- AlicenseCqualityFmaintenanceEnables AI assistants to manage infrastructure using Ansible and Terraform with 58 tools for playbooks, provisioning, security scanning, and more.877MIT