test/config/deploy.rb in yyuu-capistrano-chef-solo-0.1.2 vs test/config/deploy.rb in yyuu-capistrano-chef-solo-0.1.3

- old
+ new

@@ -6,11 +6,15 @@ set :deploy_via, :copy set :scm, :none set :use_sudo, false set :user, "vagrant" set :password, "vagrant" -set :ssh_options, {:user_known_hosts_file => "/dev/null"} +set :ssh_options, { + :auth_methods => %w(publickey password), + :keys => File.join(ENV["HOME"], ".vagrant.d", "insecure_private_key"), + :user_known_hosts_file => "/dev/null", +} role :web, "192.168.33.10" role :app, "192.168.33.10" role :db, "192.168.33.10", :primary => true @@ -196,11 +200,17 @@ "local" => { :scm => :none, :repository => File.expand_path("..", File.dirname(__FILE__)), :cookbooks => "config/cookbooks", }, - chef_solo_cookbooks_name => { + "single" => { + :cookbook_name => "single", + :scm => :none, + :repository => File.expand_path("..", File.dirname(__FILE__)), + :cookbooks => "config/cookbook", + }, + application => { :scm => :git, :repository => "git://github.com/yyuu/capistrano-chef-solo.git", :revision => "develop", :cookbooks => "test/config/cookbooks-ext", }, @@ -216,11 +226,11 @@ assert_run_list(expected) check_applied_recipes!(expected) } task(:test_run_list) { - expected = %w(recipe[foo] recipe[one]) + expected = %w(recipe[foo] recipe[single] recipe[one]) chef_solo.run_list expected assert_run_list(expected) check_applied_recipes!(expected) } } @@ -236,18 +246,23 @@ task(:setup) { set(:chef_solo_bootstrap, true) set(:chef_solo_bootstrap_user, "bootstrap") set(:chef_solo_bootstrap_password, "bootstrap") + set(:chef_solo_bootstrap_ssh_options, { +# :auth_methods => %w(password), #==> setting :auth_methods throws Net::SSH::AuthenticationFailed (capistrano bug?) + :user_known_hosts_file => "/dev/null", + }) run("getent passwd #{chef_solo_bootstrap_user.dump} || " + "#{sudo} useradd -m -p #{chef_solo_bootstrap_password.crypt(chef_solo_bootstrap_password).dump} #{chef_solo_bootstrap_user.dump}") } task(:teardown) { set(:chef_solo_bootstrap, false) - set(:chef_solo_bootstrap_user, nil) - set(:chef_solo_bootstrap_password, nil) + unset(:chef_solo_bootstrap_user) + unset(:chef_solo_bootstrap_password) + unset(:chef_solo_bootstrap_ssh_options) } task(:test_connect_with_settings) { x = 0 run("echo #{user.dump} = $(whoami) && test vagrant = $(whoami)") @@ -278,15 +293,17 @@ task(:setup) { set(:chef_solo_bootstrap, false) set(:chef_solo_bootstrap_user, "bootstrap") set(:chef_solo_bootstrap_password, "bootstrap") + set(:chef_solo_bootstrap_ssh_options, {:user_known_hosts_file => "/dev/null"}) } task(:teardown) { set(:chef_solo_bootstrap, false) - set(:chef_solo_bootstrap_user, nil) - set(:chef_solo_bootstrap_password, nil) + unset(:chef_solo_bootstrap_user) + unset(:chef_solo_bootstrap_password) + unset(:chef_solo_bootstrap_ssh_options) } task(:test_connect_with_settings) { x = 0 run("echo #{user.dump} = $(whoami) && test vagrant = $(whoami)")