diff --git a/plugins/provisioners/chef/config/base.rb b/plugins/provisioners/chef/config/base.rb index 463755692..edc4cd1fb 100644 --- a/plugins/provisioners/chef/config/base.rb +++ b/plugins/provisioners/chef/config/base.rb @@ -19,6 +19,8 @@ module VagrantPlugins attr_accessor :node_name attr_accessor :provisioning_path attr_accessor :run_list + attr_accessor :file_cache_path + attr_accessor :file_backup_path def initialize super @@ -38,6 +40,8 @@ module VagrantPlugins @no_proxy = UNSET_VALUE @node_name = UNSET_VALUE @provisioning_path = UNSET_VALUE + @file_cache_path = UNSET_VALUE + @file_backup_path = UNSET_VALUE @json = {} @run_list = [] @@ -59,6 +63,8 @@ module VagrantPlugins @no_proxy = nil if @no_proxy == UNSET_VALUE @node_name = nil if @node_name == UNSET_VALUE @provisioning_path = nil if @provisioning_path == UNSET_VALUE + @file_backup_path = "/var/chef/backup" if @file_backup_path == UNSET_VALUE + @file_cache_path = "/var/chef/cache" if @file_cache_path == UNSET_VALUE # Make sure the log level is a symbol @log_level = @log_level.to_sym diff --git a/plugins/provisioners/chef/config/chef_client.rb b/plugins/provisioners/chef/config/chef_client.rb index 899927213..ad0457593 100644 --- a/plugins/provisioners/chef/config/chef_client.rb +++ b/plugins/provisioners/chef/config/chef_client.rb @@ -9,8 +9,6 @@ module VagrantPlugins attr_accessor :encrypted_data_bag_secret_key_path attr_accessor :encrypted_data_bag_secret attr_accessor :environment - attr_accessor :file_cache_path - attr_accessor :file_backup_path attr_accessor :validation_key_path attr_accessor :validation_client_name @@ -22,8 +20,6 @@ module VagrantPlugins @encrypted_data_bag_secret_key_path = UNSET_VALUE @encrypted_data_bag_secret = UNSET_VALUE @environment = UNSET_VALUE - @file_cache_path = UNSET_VALUE - @file_backup_path = UNSET_VALUE @validation_key_path = UNSET_VALUE @validation_client_name = UNSET_VALUE end @@ -36,8 +32,6 @@ module VagrantPlugins @encrypted_data_bag_secret_key_path = nil if @encrypted_data_bag_secret_key_path == UNSET_VALUE @encrypted_data_bag_secret = "/tmp/encrypted_data_bag_secret" if @encrypted_data_bag_secret == UNSET_VALUE @environment = nil if @environment == UNSET_VALUE - @file_backup_path = "/srv/chef/cache" if @file_backup_path == UNSET_VALUE - @file_cache_path = "/srv/chef/file_store" if @file_cache_path == UNSET_VALUE @validation_client_name = "chef-validator" if @validation_client_name == UNSET_VALUE @validation_key_path = nil if @validation_key_path == UNSET_VALUE end diff --git a/plugins/provisioners/chef/config/chef_solo.rb b/plugins/provisioners/chef/config/chef_solo.rb index c23560180..0c1019647 100644 --- a/plugins/provisioners/chef/config/chef_solo.rb +++ b/plugins/provisioners/chef/config/chef_solo.rb @@ -11,7 +11,6 @@ module VagrantPlugins attr_accessor :nfs attr_accessor :encrypted_data_bag_secret_key_path attr_accessor :encrypted_data_bag_secret - attr_accessor :file_cache_path def initialize super @@ -23,7 +22,6 @@ module VagrantPlugins @nfs = UNSET_VALUE @encrypted_data_bag_secret = UNSET_VALUE @encrypted_data_bag_secret_key_path = UNSET_VALUE - @file_cache_path = UNSET_VALUE @__defaulted_cookbooks_path = false end @@ -57,8 +55,6 @@ module VagrantPlugins @encrypted_data_bag_secret == UNSET_VALUE @encrypted_data_bag_secret_key_path = nil if \ @encrypted_data_bag_secret_key_path == UNSET_VALUE - @file_cache_path = nil if \ - @file_cache_path == UNSET_VALUE end def validate(machine) diff --git a/plugins/provisioners/chef/provisioner/base.rb b/plugins/provisioners/chef/provisioner/base.rb index 5370ded4d..4bb591438 100644 --- a/plugins/provisioners/chef/provisioner/base.rb +++ b/plugins/provisioners/chef/provisioner/base.rb @@ -60,6 +60,9 @@ module VagrantPlugins config_file = Vagrant::Util::TemplateRenderer.render(template, { :custom_configuration => remote_custom_config_path, + :file_cache_path => @config.file_cache_path, + :file_backup_path => @config.file_backup_path, + :log_level => @config.log_level.to_sym, :http_proxy => @config.http_proxy, :http_proxy_user => @config.http_proxy_user, :http_proxy_pass => @config.http_proxy_pass, diff --git a/plugins/provisioners/chef/provisioner/chef_client.rb b/plugins/provisioners/chef/provisioner/chef_client.rb index d14a6862c..c4a5e886d 100644 --- a/plugins/provisioners/chef/provisioner/chef_client.rb +++ b/plugins/provisioners/chef/provisioner/chef_client.rb @@ -50,8 +50,6 @@ module VagrantPlugins :validation_client_name => @config.validation_client_name, :validation_key => guest_validation_key_path, :client_key => @config.client_key_path, - :file_cache_path => @config.file_cache_path, - :file_backup_path => @config.file_backup_path, :environment => @config.environment, :encrypted_data_bag_secret => @config.encrypted_data_bag_secret }) diff --git a/plugins/provisioners/chef/provisioner/chef_solo.rb b/plugins/provisioners/chef/provisioner/chef_solo.rb index 302cefd2a..82b73a7c3 100644 --- a/plugins/provisioners/chef/provisioner/chef_solo.rb +++ b/plugins/provisioners/chef/provisioner/chef_solo.rb @@ -133,7 +133,6 @@ module VagrantPlugins :roles_path => roles_path, :data_bags_path => data_bags_path, :encrypted_data_bag_secret => @config.encrypted_data_bag_secret, - :file_cache_path => @config.file_cache_path || @config.provisioning_path, }) end diff --git a/templates/provisioners/chef_solo/solo.erb b/templates/provisioners/chef_solo/solo.erb index b324acfd5..9ce1be72b 100644 --- a/templates/provisioners/chef_solo/solo.erb +++ b/templates/provisioners/chef_solo/solo.erb @@ -1,7 +1,8 @@ <% if node_name %> node_name "<%= node_name %>" <% end %> -file_cache_path "<%= file_cache_path %>" +file_cache_path "<%= file_cache_path %>" +file_backup_path "<%= file_backup_path %>" cookbook_path <%= cookbooks_path.inspect %> <% if roles_path %> role_path <%= roles_path.inspect %>