chef-provisioning-aws
chef-provisioning-aws copied to clipboard
Error when converging cookbooks depending on 'aws' cookbook
Whenever a cookbook using the chef-provisioning-aws driver depends on the 'aws' cookbook, converging fails at cookbooks compilation time with the following error:
[..]
Compiling Cookbooks...
================================================================================
Recipe Compile Error in /path/to/your/cookbook/development/directory/.chef/local-mode-cache/cache/cookbooks/aws-bug-cookbook/recipes/default.rb
================================================================================
TypeError
---------
superclass mismatch for class AwsEbsVolume
Cookbook Trace:
---------------
/path/to/your/cookbook/development/directory/.chef/local-mode-cache/cache/cookbooks/aws-bug-cookbook/recipes/default.rb:15:in `require'
/path/to/your/cookbook/development/directory/.chef/local-mode-cache/cache/cookbooks/aws-bug-cookbook/recipes/default.rb:15:in `from_file'
Relevant File Content:
----------------------
/path/to/your/cookbook/development/directory/.chef/local-mode-cache/cache/cookbooks/aws-bug-cookbook/recipes/default.rb:
8: #
9: # Licensed under the Apache License, Version 2.0 (the "License");
10: # you may not use this file except in compliance with the License.
11: # You may obtain a copy of the License at
12: #
13: # http://www.apache.org/licenses/LICENSE-2.0
14:
15>> require 'chef/provisioning/aws_driver'
16: with_driver 'aws'
17:
[..]
Full instructions on https://gist.github.com/esciara/d0921bded64568dc6424
This stops me completly from deploying cookbooks such as https://github.com/bflad/chef-confluence .
That gist is missing
@Jimflip sorry... had left a '/edit' in the link. Corrected now, you should be able to access it
The aws
LWRP is going to create these resources:
Chef::Resource::AwsEbsRaid
Chef::Resource::AwsEbsVolume
Chef::Resource::AwsElasticIp
Chef::Resource::AwsElasticLb
Chef::Resource::AwsInstanceMonitoring
Chef::Resource::AwsResourceTag
of which AwsEbsVolume is going to have the superclass conflict. Not sure how to work around that.
Yep, we had a discussion around that on https://gitter.im/chef/chef-provisioning/archives/2015/01/27 and PR #70 has been created to fix this.
Another solution is not to use the https://github.com/opscode-cookbooks/aws cookbook. I don't really understand how it is called in the cookbook I am using (https://github.com/bflad/chef-confluence) since, from what I can see, it is only referred to in dependencies with suggest
or recommend
, and not depends
. Need to dig a little deeper...
I saw in Gitter that you'd asked about how the 'aws' cookbook creates the Chef::Resource::AwsEbsVolume class. That's part of the LWRP magic, e.g. http://www.rubydoc.info/github/opscode/chef/Chef/Resource/LWRPBase, which takes the names you're providing in the LWRP and generates Chef::Resource::CookbooknameResourceName resources.
Since the cookbook is 'aws' and the resource is 'ebs_volume' you got AwsEbsVolume from this file: https://github.com/opscode-cookbooks/aws/blob/master/resources/ebs_volume.rb
Thanks @pburkholder . I ended up working this out but did not have any reference, which you now gave!
I think we should close this, per the discussion in #70. The AWS cookbook and this have a name collision you shouldn't use both in the same cookbook dependency chain until the functionality of the two are merged.
I do wonder ... what if we modified the aws cookbook so it used chef-provisioning, and made sure we supported the same attributes?
Our answer for this at the moment is indeed "at 1.0, you should not use both at the same time." I'd like to see if we can find a way through, so leaving it open at the moment and putting milestone=Later.
Is any progress being made on this ? I am trying to converge a node that will be the provisioning node running chef-provisioning-aws recipes to create all the other servers in the local infrastructure. I need to use the aws cookbook for the aws_s3_file lwrp to retrieve files from S3 when converging my provisioning server. I like @jkeiser's suggestion of implementing the aws cookbook using chef-provisioning. Is anyone actually working on a solution at this time ?
@robcoward The Chef Provisioning team sat down to hash out a pathway forward. #223 is a step toward making this a reality, but it may be a short while before we get there.
Perhaps we should close this (per #70 and #223)? The aws_ebs_volume
and aws_eip_address
resources should round out the things we need to cannibalize out of the aws cookbook.
Hi @gmiranda23, as a work around for now, I have implemented the aws_s3_file lwrp in my own cookbook to remove the aws cookbook dependency, so I'll be keeping a close eye on #223. I don't see any problem in closing this issue given the team has a plan moving forward. Thanks for all the hard work :-)
This is sloppy, this is what's driving people from Chef. You guys maintain BOTH repositories.
@gmiranda23 @jkeiser any update on this? haven't seen any movement in over a year
Is there any progress at all on this? over 2 years from the time this issue was noticed...