简体   繁体   English

AWS Opsworks自定义配方看不到属性

[英]AWS Opsworks custom recipes don't see attributes

I have a problem with AWS OpsWorks custom recipes. 我对AWS OpsWorks自定义配方有疑问。 After moving nodes to chef 11 the attributes are not "seen" in recipes. 在将节点移动到厨师11之后,在配方中就不会“看到”属性。 Example: in file recipes/some-service.rb i got entry 示例:在文件配方/some-service.rb中,我输入了

remote_file local_file do
    source node['servicename']['https_download']
    owner node['servicename']['app_user']
    group node['servicename']['app_group']
    mode 0664
end

in file attributes/some-service.rb: 在文件attribute / some-service.rb中:

default['servicename']['https_download'] = 'https://corect.address.of.file'
default['servicename']['app_user'] = 'someuser'
default['servicename']['app_group'] = 'somegroup'

When I try to deploy app I get an error: 当我尝试部署应用程序时出现错误:

ERROR: Caught exception while compiling OpsWorks custom run list: Chef::Exceptions::InvalidRemoteFileURI - nil is not a valid source parameter for remote_file. 错误:编译OpsWorks自定义运行列表时捕获到异常:Chef :: Exceptions :: InvalidRemoteFileURI-nil不是remote_file的有效source参数。 source must be an absolute URI or an array of URIs. source必须是绝对URI或URI数组。 - /opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/remote_file.rb:67:in `validate_source' -/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/remote_file.rb:67:在`validate_source'中

It seems like it gets nil instead value from attributes. 似乎它从属性获取零而不是值。 What may I doing wrong? 我可能做错了什么?

I'm having the same issue. 我有同样的问题。 Opsworks also is not seeing resources from the cookbooks that I'm using. Opsworks也没有从我正在使用的食谱中看到资源。 I manually set the attribute in the recipe that it was complaining about the nil[] and that got me past that one just to turn up the resource not found issue... 我在食谱中手动设置了该属性,抱怨它是nil [],这使我摆脱了仅仅为了增加未找到资源的问题...

I'm still digging and will post back if/when I find the answer... 我仍在挖掘中,如果找到答案,便会发回邮件...

EDIT: 编辑:

What I believe has happened here is that there was a problem prior to my issue that kept chef-solo from loading the attribute data into the .json file that chef-solo uses to run. 我相信这里发生的是在我的问题发生之前,有一个问题使Chef-Solo无法将属性数据加载到Chef-Solo用来运行的.json文件中。 Once I fixed the first issue, the data was still non existent in the .json file for those attributes. 解决了第一个问题后,这些属性的.json文件中的数据仍然不存在。 Once I fixed the issue and it got past that point, the issue went away. 一旦解决了问题,问题就解决了。

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

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