# # Author:: Adam Jacob () # Author:: Christopher Brown () # Author:: AJ Christensen () # Copyright:: Copyright (c) 2008 Opscode, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'chef/log' require 'mixlib/config' class Chef class Config extend Mixlib::Config def self.inspect configuration.inspect end # Override the config dispatch to set the value of log_location configuration option # # === Parameters # location:: Logging location as either an IO stream or string representing log file path # config_attr_writer :log_location do |location| if location.respond_to? :sync= location.sync = true location elsif location.respond_to? :to_str f = File.new(location.to_str, "a") f.sync = true f end end # 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 } # Where cookbook files are stored on the server (by content checksum) checksum_path "#{ENV['HOME']}/.microwave/checksums" # Where chef's cache files should be stored file_cache_path "#{ENV['HOME']}/.microwave/cache" # Where backups of chef-managed files should go file_backup_path "#{ENV['HOME']}/.microwave/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" 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" ] # Report Handlers report_handlers [] # Exception Handlers exception_handlers [] # Start handlers start_handlers [] # Checksum Cache # Uses Moneta on the back-end cache_type "BasicFile" cache_options({ :path => "#{ENV['HOME']}/.microwave/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+$/ ] end end