简体   繁体   中英

AWS Opsworks custom recipes don't see attributes

I have a problem with AWS OpsWorks custom recipes. After moving nodes to chef 11 the attributes are not "seen" in recipes. Example: in file recipes/some-service.rb i got entry

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:

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. source must be an absolute URI or an array of URIs. - /opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/remote_file.rb:67:in `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. 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...

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. Once I fixed the first issue, the data was still non existent in the .json file for those attributes. Once I fixed the issue and it got past that point, the issue went away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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