【问题标题】:OpsWorks Chef AWS Cookbook uninitialized constant AwsOpsWorks Chef AWS Cookbook 未初始化常量 Aws
【发布时间】:2016-03-01 21:00:23
【问题描述】:

我正在尝试使用来自 chef-cookbooks/aws (https://github.com/chef-cookbooks/aws) 的 s3_file。我尝试了以下几种变体,但都失败了:

include_recipe 'aws'
include_recipe 's3_file'

aws_s3_file '/usr/local/file.tar.gz' do
  bucket 'my-bucket'
  remote_path 'file.tar.gz'
  owner 'user'
  group 'user'
  aws_access_key_id 'secret'
  aws_secret_access_key 'secret'
end

这是我的错误:

名称错误
---------
未初始化的常量 Aws

几周来我一直在关注两个相关的问题:

[1]https://github.com/chef-cookbooks/aws/pull/183#issuecomment-159456234
[2]https://github.com/chef-cookbooks/aws/issues/181#issuecomment-159687243

问题 #183 引用了 aws 食谱中的以下内容:

https://github.com/chef-cookbooks/aws#defaultrb

The default recipe installs the aws-sdk Ruby Gem, which this cookbook requires
in order to work with the EC2 API. Make sure that the aws recipe is in the 
node or role run_list before any resources from this cookbook are used.

    "run_list": [
      "recipe[aws]"
    ]

我确实看到正在安装所需的 gem。我还看到 aws 和 s3_file 食谱安装在 berkshelf-cookbooks 中的实例上。

我不明白如何将 aws 配方添加到 OpsWorks 中的 run_list。我试过直接执行 aws::default 没有运气。有人可以为我提供有关如何将配方添加到 OpsWorks 中的 run_list 的示例或指导吗?

我怀疑我的问题与新手有关。我可能会在基于俗气的烹饪术语(双关语)和 OpsWorks 提供的抽象之间感到困惑。如果我未能提供任何详细信息,请告诉我。

【问题讨论】:

    标签: chef-infra aws-sdk cookbook aws-opsworks


    【解决方案1】:

    不管怎样,这是 aws Chef Cookbook 新版本的一个持续问题。最近的错误报告进一步证实了这一点:

    https://github.com/chef-cookbooks/aws/issues/181#issuecomment-159687243

    降级到 v2.5.0 解决了我的所有问题。

    【讨论】:

      猜你喜欢
      • 2015-04-14
      • 2018-02-19
      • 2012-04-25
      • 2017-07-01
      • 2018-03-08
      • 2014-05-14
      • 1970-01-01
      • 2014-07-03
      • 1970-01-01
      相关资源
      最近更新 更多