lib/chef/config.rb in microwave-0.1006.16 vs lib/chef/config.rb in microwave-0.1006.17
- old
+ new
@@ -18,10 +18,12 @@
# limitations under the License.
require 'chef/log'
require 'mixlib/config'
+$microwave_root ||= "#{ENV['HOME']}/.microwave"
+
class Chef
class Config
extend Mixlib::Config
@@ -48,38 +50,38 @@
# Turn on "path sanity" by default. See also: http://wiki.opscode.com/display/chef/User+Environment+PATH+Sanity
enforce_path_sanity(true)
# Where the cookbooks are located. Meaning is somewhat context dependent between
# chef-client, and chef-solo.
- cookbook_path [ "#{ENV['HOME']}/cookbooks" ] + $:.collect {|x| File.join(File.expand_path("..", x), "cookbooks") }.select {|x| File.directory? x }
+ cookbook_path [ "#{$microwave_root}/cookbooks" ] + $:.collect {|x| File.join(File.expand_path("..", x), "cookbooks") }.select {|x| File.directory? x }
# Where cookbook files are stored on the server (by content checksum)
- checksum_path "#{ENV['HOME']}/.microwave/checksums"
+ checksum_path "#{$microwave_root}/checksums"
# Where chef's cache files should be stored
- file_cache_path "#{ENV['HOME']}/.microwave/cache"
+ file_cache_path "#{$microwave_root}/cache"
# Where backups of chef-managed files should go
- file_backup_path "#{ENV['HOME']}/.microwave/backup"
+ file_backup_path "#{$microwave_root}/backup"
interval nil
log_level :info
log_location STDOUT
# toggle info level log items that can create a lot of output
verbose_logging true
node_name nil
- node_path "#{ENV['HOME']}/nodes"
+ node_path "#{$microwave_root}/nodes"
pid_file nil
run_command_stderr_timeout 120
run_command_stdout_timeout 120
solo false
splay nil
# Where should chef-solo look for role files?
- role_path [ "#{ENV['HOME']}/roles" ]
+ role_path [ "#{$microwave_root}/roles" ]
# Report Handlers
report_handlers []
# Exception Handlers
@@ -89,10 +91,10 @@
start_handlers []
# Checksum Cache
# Uses Moneta on the back-end
cache_type "BasicFile"
- cache_options({ :path => "#{ENV['HOME']}/.microwave/cache/checksums", :skip_expires => true })
+ cache_options({ :path => "#{$microwave_root}}/cache/checksums", :skip_expires => true })
# Those lists of regular expressions define what chef considers a
# valid user and group name
user_valid_regex [ /^([-a-zA-Z0-9_.]+)$/, /^\d+$/ ]
group_valid_regex [ /^([-a-zA-Z0-9_.\\ ]+)$/, /^\d+$/ ]