厨师-如何在本地运行食谱 [英] Chef - How to run a cookbook locally

查看:56
本文介绍了厨师-如何在本地运行食谱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始接触Chef,并且已经浏览了其站点上的教程,但是所有内容似乎都假设您要为部署配置一个Chef服务器等

I'm just getting started with Chef and have gone through the tutorials on their site, however everything seems to assume you'd be configuring a chef server etc. for the deploy

我目前正在AWS AWS Opsworks上设置网站,因此我想使用Chef进行配置和安装依赖项。因此,我相信我只是为我的菜谱提供了一条道路。现在,在进入Opsworks之前,我试图在ubuntu VM上创建我的菜谱并测试它是否正确安装了所有内容。

I'm currently in the process of setting up a site on AWS opsworks so I wanted to use Chef for the configuration and installing dependencies. As such I believe I just supply a path to my cookbook. Now before I launch into Opsworks I was trying to create my cookbook on an ubuntu VM and test that it installs everything correctly.

我知道我可以使用一个脚本 chef-client file.rb 命令运行它,但是如何以类似的方式在本地计算机上运行食谱?我已经尝试过

I know that for a single script I can use the chef-client file.rb command to run it, but how can I run a cookbook on a local machine in a similar fashion? I've tried

厨师客户chef-repo
但是,即使使用基本的'motd'示例

chef-client chef-repo But this errors, even when using the basic 'motd' example

我尝试搜索示例,但是正如我所说的,Chef是新手,所以我不确定我是否使用术语搜索是正确的。

I've tried searching for examples, but as I say I'm new to Chef so I'm not sure if the terminology I'm searching for is correct.

这甚至是使用Chef开发Opsworks的正确方法吗?

Is this even the correct approach for developing for Opsworks with Chef?

谢谢

推荐答案

OpsWorks是Amazon Web Services的托管产品,没有本地开发环境。您将必须创建一个EC2实例并将其用于测试等。不幸的是,亚马逊拒绝了大多数Chef生态系统工具,因此,虽然OpsWorks由Chef提供支持,但它也是完全不同的野兽。

OpsWorks is a hosted product of Amazon Web Services, there is no local development environment for it. You would have to create an EC2 instance and use it for testing et al. Unfortunately Amazon has rejected most of the Chef ecosystem tools, so while OpsWorks is powered by Chef it is also a very different beast.

对于OpsWorks以外的普通Chef,您将使用Test Kitchen可以处理这种事情,它可以使用Vagrant或其他系统(docker,ec2等)创建测试VM,安装Chef,运行您的食谱,然后运行一些测试。

For normal Chef outside of OpsWorks you would use Test Kitchen for this kind of thing, it handles creating a test VM using Vagrant or another system (docker, ec2, etc), installing Chef, running your cookbook(s), and then running some tests.

这篇关于厨师-如何在本地运行食谱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆