【问题标题】:Use ssh_authorized_keys external cookbook with Amazon OpsWorks将 ssh_authorized_keys 外部说明书与 Amazon OpsWorks 一起使用
【发布时间】:2016-11-03 16:51:02
【问题描述】:

作为一名厨师新手,我很难将 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 'alice@example.com'
license 'all_rights'
description 'Installs/Configures chef-provisioning'
long_description 'Installs/Configures chef-provisioning'
version '0.1.0'
depends 'ssh_authorized_keys'

【问题讨论】:

    标签: chef-infra aws-opsworks


    【解决方案1】:

    关键是目录结构。 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

    【讨论】:

      猜你喜欢
      • 2013-03-03
      • 2017-08-04
      • 2015-02-14
      • 2013-08-29
      • 2016-06-04
      • 2023-04-03
      • 1970-01-01
      • 2012-03-12
      • 1970-01-01
      相关资源
      最近更新 更多