Closed hemalvarambhia closed 10 years ago
I suggest you look at the example repo: https://github.com/zpatten/cc-chef-repo
In the very near future, cucumber-chef will be refactored to run via TestLab: https://github.com/zpatten/testlab
To further clarify, I think the book Test-Driven Infrastructure with Chef is quite old and for the most part does not apply to the latest versions of Cucumber-Chef. Unless a new book was released...
Thank you, Anuj. It does appear that a significant number of changes have been made to the framework. I will check out the example mentioned earlier.
Indeed; you guys will have to badger Stephen about that; he told me he would be releasing an updated copy of the book during ChefConf this year; but it looks like that fell through... :(
Hi, I got everthing running. Only thing is I had to use an older build of VirtualBox. Thanks a lot to both of you for the note and instructions. This issue can be closed.
Np! Glad you worked it all out.
I am following the 'Test-Driven Infrastructure with Chef' book. I tried to run the command cucumber-chef setup with the provider in config.rb set to :aws to try and setup an Amazon ec2 instance. My opcode client and validation keys are in the chef_repo/.chef directory, as is the key value pair generated by the AWS management console (id_rsa-ec2.pem). My knife script looks like this:
current_dir = File.dirname(FILE) user = "hnvarambhia" log_level :info log_location STDOUT node_name "hnvarambhia" client_key "#{current_dir}/hnvarambhia.pem" validation_client_name "musbury-validator" validation_key "#{current_dir}/musbury-validator.pem" chef_server_url "https://api.opscode.com/organizations/musbury" cache_type 'BasicFile' cache_options( :path => "#{ENV['HOME']}/.chef/checksums" ) cookbook_path ["#{current_dir}/../cookbooks"] knife[:aws_access_key_id] = ENV['AWS_ACCESS_KEY_ID'] knife[:aws_secret_access_key] = ENV['AWS_SECRET_ACCESS_KEY'] knife[:identity_file] = "#{current_dir}/id_rsa-ec2" knife[:aws_ssh_key_id] = ENV['AWS_SSH_KEY_ID']
On executing the command cucumber-chef setup I got the following stack trace:
Uploading embedded chef-repo /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@global/gems/net-ssh-2.6.6/lib/net/ssh.rb:201:in'
start': ubuntu (Net::SSH::AuthenticationFailed) from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/ssh.rb:165:in
ssh' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/ssh/exec.rb:53:inblock (2 levels) in exec' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/rescue_retry.rb:114:in
call' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/rescue_retry.rb:114:intry' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/ssh/exec.rb:51:in
block in exec' from /Users/hemalvarambhia/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:58:intimeout' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/ssh/exec.rb:50:in
exec' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/cucumber-chef-3.0.8/lib/cucumber/chef/provisioner.rb:74:inblock in upload_chef_repo' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/benchmark.rb:88:in
block (2 levels) in bench' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/spinner.rb:59:inspin' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/benchmark.rb:87:in
block in bench' from /Users/hemalvarambhia/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:inrealtime' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/ztk-1.6.1/lib/ztk/benchmark.rb:84:in
bench' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/cucumber-chef-3.0.8/lib/cucumber/chef/provisioner.rb:61:inupload_chef_repo' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/cucumber-chef-3.0.8/lib/cucumber/chef/provisioner.rb:45:in
build' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/cucumber-chef-3.0.8/bin/cucumber-chef:94:insetup' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@global/gems/thor-0.15.2/lib/thor/task.rb:27:in
run' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@global/gems/thor-0.15.2/lib/thor/invocation.rb:120:ininvoke_task' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@global/gems/thor-0.15.2/lib/thor.rb:275:in
dispatch' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@global/gems/thor-0.15.2/lib/thor/base.rb:408:instart' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/gems/cucumber-chef-3.0.8/bin/cucumber-chef:545:in
<top (required)>' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/bin/cucumber-chef:23:inload' from /Users/hemalvarambhia/.rvm/gems/ruby-1.9.2-p320@chef/bin/cucumber-chef:23:in
cucumber-chef display config is as follows:
:mode: :user :prerelease: false :user: hnvarambhia :artifacts: chef-client-log: /var/log/chef/client.log chef-client-stacktrace: /var/chef/cache/chef-stacktrace.out :chef: :version: latest :container_version: latest :default_password: p@ssw0rd1 :render_client_rb: true :cookbook_paths:
cookbooks :prereleases: false :nightlies: false :test_lab: :hostname: cucumber-chef :tld: test-lab :command_timeout: 1800 :provider: :aws :aws: :bootstrap_user: ubuntu :lab_user: cucumber-chef :lxc_user: root :ssh: :lab_port: 22 :lxc_port: 22 :ubuntu_release: precise :aws_instance_arch: i386 :aws_instance_disk_store: ebs :aws_instance_type: c1.medium :aws_security_group: cucumber-chef :identity_file: ubuntu :aws_access_key_id: [REDACTED] :aws_secret_access_key: [REDACTED] :aws_ssh_key_id: id_rsa-ec2 :region: us-west-2 :availability_zone: us-west-2a :vagrant: :bootstrap_user: vagrant :lab_user: cucumber-chef :lxc_user: root :ssh: :lab_ip: 192.168.33.10 :lab_port: 22 :lxc_port: 22 :cpus: 4 :memory: 4096 :identity_file: /Users/hemalvarambhia/.vagrant.d/insecure_private_key
bootstrap_user = "ubuntu" bootstrap_user_home_dir = "/home/ubuntu" bootstrap_identity = "ubuntu" lab_user = "cucumber-chef" lab_user_home_dir = "/home/cucumber-chef" lab_identity = "/Users/hemalvarambhia/RubymineProjects/chef-repo/.cucumber-chef/aws/id_rsa-cucumber-chef" lxc_user = "root" lxc_user_home_dir = "/root" lxc_identity = "/Users/hemalvarambhia/RubymineProjects/chef-repo/.cucumber-chef/aws/id_rsa-root" chef_pre_11 = false
What are the pre conditions for cucumber-chef setup to run successfully?
Many thanks, Hemal