Module: ChefDK::Configurable
- Included in:
- ChefDK::Command::CleanPolicyCookbooks, ChefDK::Command::CleanPolicyRevisions, ChefDK::Command::DeletePolicy, ChefDK::Command::DeletePolicyGroup, ChefDK::Command::Diff, ChefDK::Command::Export, ChefDK::Command::GeneratorCommands::Base, ChefDK::Command::Install, ChefDK::Command::Push, ChefDK::Command::PushArchive, ChefDK::Command::ShowPolicy, ChefDK::Command::Undelete, ChefDK::Command::Update
- Defined in:
- lib/chef-dk/configurable.rb
Instance Method Summary collapse
- #chef_config ⇒ Object
- #chefdk_config ⇒ Object
- #config_loader ⇒ Object
- #default_chef_server_http_client ⇒ Object
- #generator_config ⇒ Object
- #knife_config ⇒ Object
- #reset_config! ⇒ Object
Instance Method Details
#chef_config ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/chef-dk/configurable.rb', line 50 def chef_config return @chef_config if @chef_config config_loader.load @chef_config = Chef::Config CookbookOmnifetch.integration.default_chef_server_http_client = default_chef_server_http_client @chef_config end |
#chefdk_config ⇒ Object
59 60 61 |
# File 'lib/chef-dk/configurable.rb', line 59 def chefdk_config chef_config.chefdk end |
#config_loader ⇒ Object
63 64 65 |
# File 'lib/chef-dk/configurable.rb', line 63 def config_loader @config_loader ||= Chef::WorkstationConfigLoader.new(config[:config_file]) end |
#default_chef_server_http_client ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/chef-dk/configurable.rb', line 80 def default_chef_server_http_client lambda do ChefServerAPIMulti.new(@chef_config.chef_server_url, signing_key_filename: @chef_config.client_key, client_name: @chef_config.node_name) end end |
#generator_config ⇒ Object
67 68 69 |
# File 'lib/chef-dk/configurable.rb', line 67 def generator_config chefdk_config.generator end |
#knife_config ⇒ Object
71 72 73 |
# File 'lib/chef-dk/configurable.rb', line 71 def knife_config chef_config.knife end |
#reset_config! ⇒ Object
75 76 77 78 |
# File 'lib/chef-dk/configurable.rb', line 75 def reset_config! @chef_config = nil @config_loader = nil end |