Class: Vagrant::Provisioners::Chef::Config
- Inherits:
-
Config::Base
- Object
- Config::Base
- Vagrant::Provisioners::Chef::Config
- Defined in:
- lib/vagrant/provisioners/chef.rb
Overview
This is the configuration which is available through config.chef
Direct Known Subclasses
Vagrant::Provisioners::ChefClient::Config, Vagrant::Provisioners::ChefSolo::Config
Instance Attribute Summary collapse
-
#binary_env ⇒ Object
Returns the value of attribute binary_env.
-
#binary_path ⇒ Object
Returns the value of attribute binary_path.
-
#http_proxy ⇒ Object
Returns the value of attribute http_proxy.
-
#http_proxy_pass ⇒ Object
Returns the value of attribute http_proxy_pass.
-
#http_proxy_user ⇒ Object
Returns the value of attribute http_proxy_user.
-
#https_proxy ⇒ Object
Returns the value of attribute https_proxy.
-
#https_proxy_pass ⇒ Object
Returns the value of attribute https_proxy_pass.
-
#https_proxy_user ⇒ Object
Returns the value of attribute https_proxy_user.
-
#json ⇒ Object
Returns the value of attribute json.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#no_proxy ⇒ Object
Returns the value of attribute no_proxy.
-
#node_name ⇒ Object
Shared config.
-
#provisioning_path ⇒ Object
Returns the value of attribute provisioning_path.
-
#run_list ⇒ Object
Returns the run list, but also sets it up to be empty if it hasn't been defined already.
Attributes inherited from Config::Base
Instance Method Summary collapse
-
#add_recipe(name) ⇒ Object
Adds a recipe to the run list.
-
#add_role(name) ⇒ Object
Adds a role to the run list.
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #instance_variables_hash ⇒ Object
-
#merged_json ⇒ Object
This returns the json that is merged with the defaults and the user set data.
Methods inherited from Config::Base
configures, #env, json_create, #set_options, #to_hash, #to_json, #validate
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/vagrant/provisioners/chef.rb', line 103 def initialize @provisioning_path = nil @log_level = :info @json = {} @http_proxy = nil @http_proxy_user = nil @http_proxy_pass = nil @https_proxy = nil @https_proxy_user = nil @https_proxy_pass = nil @no_proxy = nil @binary_path = nil @binary_env = nil @run_list = nil end |
Instance Attribute Details
#binary_env ⇒ Object
Returns the value of attribute binary_env.
100 101 102 |
# File 'lib/vagrant/provisioners/chef.rb', line 100 def binary_env @binary_env end |
#binary_path ⇒ Object
Returns the value of attribute binary_path.
99 100 101 |
# File 'lib/vagrant/provisioners/chef.rb', line 99 def binary_path @binary_path end |
#http_proxy ⇒ Object
Returns the value of attribute http_proxy.
92 93 94 |
# File 'lib/vagrant/provisioners/chef.rb', line 92 def http_proxy @http_proxy end |
#http_proxy_pass ⇒ Object
Returns the value of attribute http_proxy_pass.
94 95 96 |
# File 'lib/vagrant/provisioners/chef.rb', line 94 def http_proxy_pass @http_proxy_pass end |
#http_proxy_user ⇒ Object
Returns the value of attribute http_proxy_user.
93 94 95 |
# File 'lib/vagrant/provisioners/chef.rb', line 93 def http_proxy_user @http_proxy_user end |
#https_proxy ⇒ Object
Returns the value of attribute https_proxy.
95 96 97 |
# File 'lib/vagrant/provisioners/chef.rb', line 95 def https_proxy @https_proxy end |
#https_proxy_pass ⇒ Object
Returns the value of attribute https_proxy_pass.
97 98 99 |
# File 'lib/vagrant/provisioners/chef.rb', line 97 def https_proxy_pass @https_proxy_pass end |
#https_proxy_user ⇒ Object
Returns the value of attribute https_proxy_user.
96 97 98 |
# File 'lib/vagrant/provisioners/chef.rb', line 96 def https_proxy_user @https_proxy_user end |
#json ⇒ Object
Returns the value of attribute json.
91 92 93 |
# File 'lib/vagrant/provisioners/chef.rb', line 91 def json @json end |
#log_level ⇒ Object
Returns the value of attribute log_level.
90 91 92 |
# File 'lib/vagrant/provisioners/chef.rb', line 90 def log_level @log_level end |
#no_proxy ⇒ Object
Returns the value of attribute no_proxy.
98 99 100 |
# File 'lib/vagrant/provisioners/chef.rb', line 98 def no_proxy @no_proxy end |
#node_name ⇒ Object
Shared config
88 89 90 |
# File 'lib/vagrant/provisioners/chef.rb', line 88 def node_name @node_name end |
#provisioning_path ⇒ Object
Returns the value of attribute provisioning_path.
89 90 91 |
# File 'lib/vagrant/provisioners/chef.rb', line 89 def provisioning_path @provisioning_path end |
#run_list ⇒ Object
Returns the run list, but also sets it up to be empty if it hasn't been defined already.
129 130 131 |
# File 'lib/vagrant/provisioners/chef.rb', line 129 def run_list @run_list ||= [] end |
Instance Method Details
#add_recipe(name) ⇒ Object
Adds a recipe to the run list
134 135 136 137 |
# File 'lib/vagrant/provisioners/chef.rb', line 134 def add_recipe(name) name = "recipe[#{name}]" unless name =~ /^recipe\[(.+?)\]$/ run_list << name end |
#add_role(name) ⇒ Object
Adds a role to the run list
140 141 142 143 |
# File 'lib/vagrant/provisioners/chef.rb', line 140 def add_role(name) name = "role[#{name}]" unless name =~ /^role\[(.+?)\]$/ run_list << name end |
#instance_variables_hash ⇒ Object
145 146 147 148 149 150 151 |
# File 'lib/vagrant/provisioners/chef.rb', line 145 def instance_variables_hash # Overridden so that the 'json' key could be removed, since its just # merged into the config anyways result = super result.delete("json") result end |
#merged_json ⇒ Object
This returns the json that is merged with the defaults and the user set data.
121 122 123 124 125 |
# File 'lib/vagrant/provisioners/chef.rb', line 121 def merged_json original = { :instance_role => "vagrant" } original[:run_list] = @run_list if @run_list original.merge(json || {}) end |