Chef server client.rb uses new templates
This commit is contained in:
parent
47a9d85b4e
commit
965e5a12f3
|
@ -39,24 +39,13 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_config
|
def setup_config
|
||||||
solo_file = <<-solo
|
solo_file = TemplateRenderer.render("chef_server_client", {
|
||||||
log_level :info
|
:node_name => env.config.chef.node_name,
|
||||||
log_location STDOUT
|
:chef_server_url => env.config.chef.chef_server_url,
|
||||||
node_name "#{env.config.chef.node_name}"
|
:validation_client_name => env.config.chef.validation_client_name,
|
||||||
ssl_verify_mode :verify_none
|
:validation_key => guest_validation_key_path,
|
||||||
chef_server_url "#{env.config.chef.chef_server_url}"
|
:client_key => env.config.chef.client_key_path
|
||||||
|
})
|
||||||
validation_client_name "#{env.config.chef.validation_client_name}"
|
|
||||||
validation_key "#{guest_validation_key_path}"
|
|
||||||
client_key "#{env.config.chef.client_key_path}"
|
|
||||||
|
|
||||||
file_store_path "/srv/chef/file_store"
|
|
||||||
file_cache_path "/srv/chef/cache"
|
|
||||||
|
|
||||||
pid_file "/var/run/chef/chef-client.pid"
|
|
||||||
|
|
||||||
Mixlib::Log::Formatter.show_time = true
|
|
||||||
solo
|
|
||||||
|
|
||||||
logger.info "Uploading chef-client configuration script..."
|
logger.info "Uploading chef-client configuration script..."
|
||||||
env.ssh.upload!(StringIO.new(solo_file), File.join(env.config.chef.provisioning_path, "client.rb"))
|
env.ssh.upload!(StringIO.new(solo_file), File.join(env.config.chef.provisioning_path, "client.rb"))
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
log_level :info
|
||||||
|
log_location STDOUT
|
||||||
|
node_name "<%= node_name %>"
|
||||||
|
ssl_verify_mode :verify_none
|
||||||
|
chef_server_url "<%= chef_server_url %>"
|
||||||
|
|
||||||
|
validation_client_name "<%= validation_client_name %>"
|
||||||
|
validation_key "<%= validation_key %>"
|
||||||
|
client_key "<%= client_key %>"
|
||||||
|
|
||||||
|
file_store_path "/srv/chef/file_store"
|
||||||
|
file_cache_path "/srv/chef/cache"
|
||||||
|
|
||||||
|
pid_file "/var/run/chef/chef-client.pid"
|
||||||
|
|
||||||
|
Mixlib::Log::Formatter.show_time = true
|
|
@ -170,6 +170,7 @@ config
|
||||||
end
|
end
|
||||||
|
|
||||||
should "upload this file as client.rb to the provisioning folder" do
|
should "upload this file as client.rb to the provisioning folder" do
|
||||||
|
Vagrant::Util::TemplateRenderer.expects(:render).returns("foo")
|
||||||
StringIO.expects(:new).returns("foo")
|
StringIO.expects(:new).returns("foo")
|
||||||
File.expects(:join).with(@env.config.chef.provisioning_path, "client.rb").once.returns("bar")
|
File.expects(:join).with(@env.config.chef.provisioning_path, "client.rb").once.returns("bar")
|
||||||
@env.ssh.expects(:upload!).with("foo", "bar").once
|
@env.ssh.expects(:upload!).with("foo", "bar").once
|
||||||
|
|
Loading…
Reference in New Issue