Class: Chef::Config
- Extended by:
- Mixlib::Config
- Defined in:
- lib/chef/config.rb
Class Method Summary collapse
- .add_formatter(name, file_path = nil) ⇒ Object
- .formatters ⇒ Object
- .inspect ⇒ Object
-
.manage_secret_key ⇒ Object
- Manages the chef secret session key === Returns <newkey>
-
A new or retrieved session key.
- .platform_specific_path(path) ⇒ Object
Instance Method Summary collapse
-
#nil ⇒ Object
Daemonization Settings ## What user should Chef run as?.
Class Method Details
.add_formatter(name, file_path = nil) ⇒ Object
61 62 63 |
# File 'lib/chef/config.rb', line 61 def self.add_formatter(name, file_path=nil) formatters << [name, file_path] end |
.formatters ⇒ Object
65 66 67 |
# File 'lib/chef/config.rb', line 65 def self.formatters @formatters ||= [] end |
.inspect ⇒ Object
46 47 48 |
# File 'lib/chef/config.rb', line 46 def self.inspect configuration.inspect end |
.manage_secret_key ⇒ Object
Manages the chef secret session key
Returns
- <newkey>
-
A new or retrieved session key
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/chef/config.rb', line 33 def self.manage_secret_key newkey = nil if Chef::FileCache.has_key?("chef_server_cookie_id") newkey = Chef::FileCache.load("chef_server_cookie_id") else chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a newkey = "" 40.times { |i| newkey << chars[rand(chars.size-1)] } Chef::FileCache.store("chef_server_cookie_id", newkey) end newkey end |
.platform_specific_path(path) ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/chef/config.rb', line 50 def self.platform_specific_path(path) if RUBY_PLATFORM =~ /mswin|mingw|windows/ # turns /etc/chef/client.rb into C:/chef/client.rb system_drive = ENV['SYSTEMDRIVE'] ? ENV['SYSTEMDRIVE'] : "" path = File.join(system_drive, path.split('/')[2..-1]) # ensure all forward slashes are backslashes path.gsub!(File::SEPARATOR, (File::ALT_SEPARATOR || '\\')) end path end |
Instance Method Details
#nil ⇒ Object
Daemonization Settings ## What user should Chef run as?
173 |
# File 'lib/chef/config.rb', line 173 user nil |