Atalanta / cucumber-chef

Framework for test-driven infrastructure development
http://cucumber-chef.org
Apache License 2.0
265 stars 55 forks source link

New Config Options #92

Closed zpatten closed 11 years ago

zpatten commented 11 years ago

The latest version of master has artifact support and allows configuration of the SSH users used for the test lab and lxc containers.

    artifacts                       ({ "chef-client-log" => "/var/log/chef/client.log",
                                       "chef-client-stacktrace" => "/var/chef/cache/chef-stacktrace.out" })
    lxc_user                        "root"
    lab_user                        "ubuntu"
zpatten commented 11 years ago

Here are the updated 2.1.0.rc.3 config variables. Some of these are auto-populated at run time; all can be overridden in the config file.

---
:mode: :user
:prerelease: true
:provider: :vagrant
:librarian_chef: true
:user: zpatten
:artifacts:
  chef-client-log: /var/log/chef/client.log
  chef-client-stacktrace: /var/chef/cache/chef-stacktrace.out
:aws:
  :lab_user: ubuntu
  :lxc_user: root
  :ubuntu_release: precise
  :aws_instance_arch: i386
  :aws_instance_disk_store: ebs
  :aws_instance_type: c1.medium
  :aws_security_group: cucumber-chef
  :identity_file: [REDACTED]
  :aws_access_key_id: [REDACTED]
  :aws_secret_access_key: [REDACTED]
  :aws_ssh_key_id: [REDACTED]
  :region: [REDACTED]
  :availability_zone: [REDACTED]
:vagrant:
  :lab_user: vagrant
  :lxc_user: root
  :identity_file: [REDACTED]
:chef:
  :amqp_password: p@ssw0rd1
  :admin_password: p@ssw0rd1
:test_lab:
  :hostname: cucumber-chef
  :tld: test-lab
:command_timeout: 1800
zpatten commented 11 years ago

Here's my current cucumber-chef config.rb file:

provider                        :vagrant
librarian_chef                  true
artifacts                       ({ "chef-client-log" => "/var/log/chef/client.log",
                                   "chef-client-stacktrace" => "/var/chef/cache/chef-stacktrace.out" })

vagrant.merge!(                 :identity_file => "#{ENV['HOME']}/.vagrant.d/insecure_private_key",
                                :lab_user => "vagrant",
                                :lxc_user => "root" )

aws.merge!(                     :identity_file => "#{ENV['HOME']}/.chef/xyz.pem",
                                :lab_user => "ubuntu",
                                :lxc_user => "root",
                                :aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'],
                                :aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
                                :aws_ssh_key_id => ENV['AWS_SSH_KEY_ID'],
                                :region => "[REDACTED]",
                                :availability_zone => "[REDACTED]",
                                :aws_instance_type => "c1.medium" )
zpatten commented 11 years ago

@pikesley ^^

zpatten commented 11 years ago

Vagrantfile will need these in it too:

  # Precise 32-bit
  # config.vm.box = "precise32"
  # config.vm.box_url = "http://files.vagrantup.com/precise32.box"

  # Precise 64-bit
  config.vm.box = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"

  config.vm.forward_port 4000, 4000
  config.vm.forward_port 4040, 4040
  config.vm.forward_port 8787, 8787
pikesley commented 11 years ago

Dude, this looks Super Awesome! Gonna get this going today (been away from Chef for a couple of weeks as I've just started a new gig). Will let you know how it goes :)

alisonjenkins commented 11 years ago

Just trying to get cucumber-chef setup with Vagrant now under Arch Linux.

So far I have installed the cucumber-chef gem from the github repo, and installed Vagrant 1.0.6.

However I have just hit a snap while trying to use the config.rb in this issue.

alan@prometheus ~ $ cucumber-chef setup                                                                                                                                                                                     [ruby-1.9.2-p320]
cucumber-chef v3.0.0.rc.0
/home/alan/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-chef-3.0.0.rc.0/bin/cucumber-chef:161:in `rescue in setup': undefined method `fatal' for nil:NilClass (NoMethodError)
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-chef-3.0.0.rc.0/bin/cucumber-chef:134:in `setup'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/gems/thor-0.17.0/lib/thor.rb:344:in `dispatch'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/gems/thor-0.17.0/lib/thor/base.rb:434:in `start'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-chef-3.0.0.rc.0/bin/cucumber-chef:588:in `<top (required)>'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/bin/cucumber-chef:19:in `load'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/bin/cucumber-chef:19:in `<main>'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/alan/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>'

Any ideas why this is not working for me?

Edit Somehow I managed to delete the 's' out of aws.merge!

Thanks