From 944a96d14185a0a3fd8c37c8e9051f27e77a2253 Mon Sep 17 00:00:00 2001 From: Dale Hofkens Date: Thu, 15 Feb 2018 14:04:57 +0100 Subject: [PATCH] allow to override file_cache_path --- lib/chef/knife/solo_cook.rb | 8 ++++++++ lib/knife-solo/resources/solo.rb.erb | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/lib/chef/knife/solo_cook.rb b/lib/chef/knife/solo_cook.rb index d7b0bc48..d0229b5f 100644 --- a/lib/chef/knife/solo_cook.rb +++ b/lib/chef/knife/solo_cook.rb @@ -71,6 +71,10 @@ class SoloCook < Knife :long => '--provisioning-path path', :description => 'Where to store kitchen data on the node' + option :file_cache_path, + :long => '--file_cache_path path', + :description => 'Where to store cache data on the node' + option :clean_up, :long => '--clean-up', :description => 'Run the clean command after cooking' @@ -156,6 +160,10 @@ def enable_reporting config_value(:enable_reporting, true) end + def file_cache_path + config_value(:file_cache_path, nil) + end + def expand_path(path) Pathname.new(path).expand_path end diff --git a/lib/knife-solo/resources/solo.rb.erb b/lib/knife-solo/resources/solo.rb.erb index e9e84d8c..b92b5d90 100644 --- a/lib/knife-solo/resources/solo.rb.erb +++ b/lib/knife-solo/resources/solo.rb.erb @@ -7,6 +7,11 @@ role_path File.join(base, 'roles') data_bag_path File.join(base, 'data_bags') encrypted_data_bag_secret File.join(base, 'data_bag_key') environment_path File.join(base, 'environments') + +<% if file_cache_path %> +file_cache_path <%= file_cache_path.inspect %> +<% end %> + environment <%= node_environment.inspect %> ssl_verify_mode <%= ssl_verify_mode.inspect %> solo_legacy_mode <%= solo_legacy_mode.inspect %>