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

#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

Attributes inherited from Config::Base

#top

Instance Method Summary collapse

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

#add_recipe, #add_role, #instance_variables_hash, #run_list, #run_list=

Methods inherited from Config::Base

configures, #env, #instance_variables_hash, json_create, #set_options, #to_hash, #to_json

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  super

  @cookbooks_path = ["cookbooks", [:vm, "cookbooks"]]
  @roles_path = []
end

Instance Attribute Details

#cookbooks_pathObject

Returns the value of attribute cookbooks_path.



8
9
10
# File 'lib/vagrant/provisioners/chef_solo.rb', line 8

def cookbooks_path
  @cookbooks_path
end

#recipe_urlObject

Returns the value of attribute recipe_url.



10
11
12
# File 'lib/vagrant/provisioners/chef_solo.rb', line 10

def recipe_url
  @recipe_url
end

#roles_pathObject

Returns the value of attribute roles_path.



9
10
11
# File 'lib/vagrant/provisioners/chef_solo.rb', line 9

def roles_path
  @roles_path
end

Instance Method Details

#validate(errors) ⇒ Object



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

def validate(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 !json[:run_list] || run_list.empty?
end