Open bbergstrom opened 9 years ago
I'm having the same problem.
https://github.com/opscode-cookbooks/aws/issues/166
I'm writing a recipe that includes the aws default recipe, and then uses the aws_ebs_volume resource. At runtime, I get the following error:
uninitialized constant Chef::Provider::Package::Rubygems::CurrentGemEnvironment::Bundler
https://gist.github.com/jcderose/0f589b36aad50c05d737
Here's my recipe:
include_recipe "opsworks_initial_setup"
include_recipe 'aws'
instance_az = node[:opsworks][:instance][:availability_zone]
device_id = "/dev/xvdx"
directory '/srv-enc' do
mode '0755'
end
aws_ebs_volume 'EncryptedVolume' do
size 8
device device_id
availability_zone instance_az
volume_type "gp2"
encrypted true
action [:create, :attach]
end
Here's my metadata.rb:
name 'setup-ebs-encryption'
maintainer 'XXXX'
maintainer_email 'XXXX'
license 'All rights reserved'
description 'Installs/Configures setup-ebs-encryption'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
depends 'opsworks_initial_setup'
depends 'aws'
Here's my Berksfile: https://gist.github.com/jcderose/1f054f7714571c25d7b1
FYI @bbergstrom, I reached out to AWS support regarding this issue and received this response:
"Thanks for reaching out. Generally speaking, the OpsWorks team has informed me that OpsWorks doesn't officially support Test Kitchen for our built-in cookbooks, since there's some setup that happens before Chef is run. Because of this, I don't believe you will be able to get past the error without actually manually editing the opsworks_commons cookbook, the way that the cookbook is composed and how OpsWorks does initial setup prior to the built-in cookbooks running."
Test kitchen executes Chef without bundler. Your cookbooks should be compatible with the popular testing framework and support bunder and non-bundler execution.