作为 Chef 新手,我很难将 ssh_authorized_keys 与 Amazon OpsWorks 结合使用。启动新实例时,出现以下错误:
[2016-07-01T10:02:37+00:00] INFO: HTTP Request Returned 412 Precondition Failed:
No such cookbook: ssh_authorized_keys
================================================================================
Error Resolving Cookbooks for Run List:
================================================================================
Missing Cookbooks:
------------------
No such cookbook: ssh_authorized_keys
Expanded Run List:
------------------
* chef-provisioning::default
我必须改变什么才能使它工作?
我使用以下配置:
Berksfile
source 'https://supermarket.chef.io'
cookbook 'ssh_authorized_keys', '~> 0.3.0'
元数据.rb
name 'chef-provisioning'
maintainer 'abc'
maintainer_email '[email protected]'
license 'all_rights'
description 'Installs/Configures chef-provisioning'
long_description 'Installs/Configures chef-provisioning'
version '0.1.0'
depends 'ssh_authorized_keys'
最佳答案
关键是目录结构。 ssh_authorized_keys
食谱必须与我们自己的食谱 ops-works
(保存普通食谱)位于同一目录中。
$ tree -d
.
├── ops-works
│ ├── recipes
│ ├── spec
│ │ └── unit
│ │ └── recipes
│ └── test
│ └── integration
│ ├── default
│ │ └── serverspec
│ └── helpers
│ └── serverspec
└── ssh_authorized_keys
├── attributes
├── definitions
├── libraries
└── templates
└── default
Berksfile
source 'https://supermarket.chef.io'
cookbook 'ssh_authorized_keys'
我建议使用
berks vendor
并查看Failing To Find Chef Community Cookbooks Using Chef 12 On AWS Opsworks
关于chef-infra - 将 ssh_authorized_keys 外部说明书与 Amazon OpsWorks 结合使用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38142638/