Class: Vagrant::Provisioners::ChefSolo::Config

Inherits:
Vagrant::Provisioners::Chef::Config show all
Defined in:
lib/vagrant/provisioners/chef_solo.rb

Instance Attribute Summary collapse

Attributes inherited from Vagrant::Provisioners::Chef::Config

#attempts, #binary_env, #binary_path, #http_proxy, #http_proxy_pass, #http_proxy_user, #https_proxy, #https_proxy_pass, #https_proxy_user, #json, #log_level, #no_proxy, #node_name, #provisioning_path, #run_list

Instance Method Summary collapse

Methods inherited from Vagrant::Provisioners::Chef::Config

#add_recipe, #add_role, #instance_variables_hash, #merged_json

Methods inherited from Config::Base

#instance_variables_hash, json_create, #merge, #set_options, #to_hash, #to_json

Constructor Details

#initializeConfig

Returns a new instance of Config.



23
24
25
26
27
# File 'lib/vagrant/provisioners/chef_solo.rb', line 23

def initialize
  super

  @__default = ["cookbooks", [:vm, "cookbooks"]]
end

Instance Attribute Details

#cookbooks_pathObject

Provide defaults in such a way that they won't override the instance variable. This is so merging continues to work properly.



31
32
33
# File 'lib/vagrant/provisioners/chef_solo.rb', line 31

def cookbooks_path
  @cookbooks_path
end

#data_bags_pathObject

Returns the value of attribute data_bags_path.



15
16
17
# File 'lib/vagrant/provisioners/chef_solo.rb', line 15

def data_bags_path
  @data_bags_path
end

#encrypted_data_bag_secretObject

Returns the value of attribute encrypted_data_bag_secret.



19
20
21
# File 'lib/vagrant/provisioners/chef_solo.rb', line 19

def encrypted_data_bag_secret
  @encrypted_data_bag_secret
end

#encrypted_data_bag_secret_key_pathObject

Returns the value of attribute encrypted_data_bag_secret_key_path.



18
19
20
# File 'lib/vagrant/provisioners/chef_solo.rb', line 18

def encrypted_data_bag_secret_key_path
  @encrypted_data_bag_secret_key_path
end

#nfsObject

Returns the value of attribute nfs.



17
18
19
# File 'lib/vagrant/provisioners/chef_solo.rb', line 17

def nfs
  @nfs
end

#recipe_urlObject

Returns the value of attribute recipe_url.



16
17
18
# File 'lib/vagrant/provisioners/chef_solo.rb', line 16

def recipe_url
  @recipe_url
end

#roles_pathObject

Returns the value of attribute roles_path.



14
15
16
# File 'lib/vagrant/provisioners/chef_solo.rb', line 14

def roles_path
  @roles_path
end

Instance Method Details

#_default_cookbook_pathObject

This stores a reference to the default cookbook path which is used later. Do not use this publicly. I apologize for not making it "protected" but it has to be called by Vagrant internals later.



38
39
40
# File 'lib/vagrant/provisioners/chef_solo.rb', line 38

def _default_cookbook_path
  @__default
end

#validate(env, errors) ⇒ Object



46
47
48
49
50
51
# File 'lib/vagrant/provisioners/chef_solo.rb', line 46

def validate(env, errors)
  super

  errors.add(I18n.t("vagrant.config.chef.cookbooks_path_empty")) if !cookbooks_path || [cookbooks_path].flatten.empty?
  errors.add(I18n.t("vagrant.config.chef.run_list_empty")) if !run_list || run_list.empty?
end