From ed3e86d20f41c9d64bf8de5b1af9c41f94a04b68 Mon Sep 17 00:00:00 2001 From: Adrian Bravo Date: Thu, 1 Apr 2010 14:24:25 -0700 Subject: [PATCH] Moved node_name from command option on chef-client to the generated config file. --- lib/vagrant/provisioners/chef_server.rb | 3 ++- test/vagrant/provisioners/chef_server_test.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/provisioners/chef_server.rb b/lib/vagrant/provisioners/chef_server.rb index e29908db2..9d93bf392 100644 --- a/lib/vagrant/provisioners/chef_server.rb +++ b/lib/vagrant/provisioners/chef_server.rb @@ -42,6 +42,7 @@ module Vagrant solo_file = <<-solo log_level :info log_location STDOUT +node_name "#{env.config.chef.node_name}" ssl_verify_mode :verify_none chef_server_url "#{env.config.chef.chef_server_url}" @@ -64,7 +65,7 @@ solo def run_chef_client logger.info "Running chef-client..." env.ssh.execute do |ssh| - ssh.exec!("cd #{env.config.chef.provisioning_path} && sudo chef-client -c client.rb -j dna.json -N #{env.config.chef.node_name}") do |channel, data, stream| + ssh.exec!("cd #{env.config.chef.provisioning_path} && sudo chef-client -c client.rb -j dna.json") do |channel, data, stream| # TODO: Very verbose. It would be easier to save the data and only show it during # an error, or when verbosity level is set high logger.info("#{stream}: #{data}") diff --git a/test/vagrant/provisioners/chef_server_test.rb b/test/vagrant/provisioners/chef_server_test.rb index 42a7365a1..7ff73dd0d 100644 --- a/test/vagrant/provisioners/chef_server_test.rb +++ b/test/vagrant/provisioners/chef_server_test.rb @@ -149,6 +149,7 @@ class ChefServerProvisionerTest < Test::Unit::TestCase expected_config = <<-config log_level :info log_location STDOUT +node_name "#{@env.config.chef.node_name}" ssl_verify_mode :verify_none chef_server_url "#{@env.config.chef.chef_server_url}" @@ -179,7 +180,7 @@ config context "running chef client" do should "cd into the provisioning directory and run chef client" do ssh = mock("ssh") - ssh.expects(:exec!).with("cd #{@env.config.chef.provisioning_path} && sudo chef-client -c client.rb -j dna.json -N #{@env.config.chef.node_name}").once + ssh.expects(:exec!).with("cd #{@env.config.chef.provisioning_path} && sudo chef-client -c client.rb -j dna.json").once @env.ssh.expects(:execute).yields(ssh) @action.run_chef_client end