简体   繁体   English

没有这样的菜谱-OpsWorks找不到自定义菜谱

[英]No such cookbook — OpsWorks can't find custom cookbook

I'm trying to figure out the best way to add an nginx server as a proxy for my node.js AWS OpsWorks machines. 我正在尝试找出添加nginx服务器作为我的node.js AWS OpsWorks计算机的代理的最佳方法。 I have not been able to get it working, as Chef/OpsWorks cannot seem to find the cookbook. 我无法使其正常运行,因为Chef / OpsWorks似乎找不到菜谱。 Here is my setup: I am using the node.js layer, and have created a git repo for the chef recipes for nginx. 这是我的设置:我正在使用node.js层,并为nginx的厨师食谱创建了一个git repo。 I have enabled custom recipes, and I have successfully used a custom HAproxy attributes file from this repo. 我已启用自定义配方,并且已成功使用此存储库中的自定义HAproxy属性文件。 The structure of the repo is as follows: 回购的结构如下:

nginx-custom
 --recipes
 --templates
 --attributes
haproxy
 --attributes

The weird thing is that the HAproxy overrides work. 奇怪的是,HAproxy会覆盖工作。 The nginx cookbook is basically copy-pasted from the OpsWorks version, with some of my own attributes (Maybe b/c it is a full cookbook is the problem?). Nginx食谱基本上是从OpsWorks版本复制粘贴的,具有我自己的一些属性(也许b / c是完整的食谱吗?)。 So when I try to run the nginx-custom cookbook as part of the setup step (I've added the name of the cookbook to the setup step with the default recipe like 'nginx-custom::default'), I get the "No such cookbook" error. 因此,当我尝试在设置步骤中运行nginx-custom菜谱时(我已将菜谱的名称添加到带有默认配方(例如'nginx-custom :: default')的设置步骤中),没有这样的食谱”错误。 I've tried running it as a standalone command with the sam result. 我尝试将其作为带有sam结果的独立命令运行。 Am I doing something obviously wrong? 我做错了什么吗? Should I use Berkshelf for this? 我应该为此使用Berkshelf吗? Should I make a custom layer instead of trying to modify an existing one? 我应该制作一个自定义图层,而不是尝试修改现有图层吗? Any help appreciated. 任何帮助表示赞赏。 Thank you. 谢谢。

Even if you've enabled custom recipes have you configured OPsWorks to go to your GIT repo? 即使启用了自定义配方,您是否也已将OPsWorks配置为转到GIT存储库?

http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-installingcustom-enable.html http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-installingcustom-enable.html

If your GIT repo is on Github for instance you'll have to also authorize Amazon to access your repo using the proper SSH Key. 例如,如果您的GIT存储库位于Github上,则您还必须授权Amazon使用正确的SSH密钥访问您的存储库。

Also ensure the nginx has all the dependencies it needs in order to run. 还要确保nginx具有运行所需的所有依赖项。 It might be easier to just put the cookbooks in a tar.gz and upload it to S3 to use. 将食谱放在tar.gz中并将其上传到S3以便使用可能会更容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM