Class: Vagrant::Provisioners::ChefClient::Config

Inherits:
Vagrant::Provisioners::Chef::Config show all
Defined in:
lib/vagrant/provisioners/chef_client.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

Instance Attribute Details

#chef_server_urlObject

Returns the value of attribute chef_server_url.



11
12
13
# File 'lib/vagrant/provisioners/chef_client.rb', line 11

def chef_server_url
  @chef_server_url
end

#client_key_pathObject

Returns the value of attribute client_key_path.



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

def client_key_path
  @client_key_path
end

#encrypted_data_bag_secretObject

Returns the value of attribute encrypted_data_bag_secret.



19
20
21
# File 'lib/vagrant/provisioners/chef_client.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_client.rb', line 18

def encrypted_data_bag_secret_key_path
  @encrypted_data_bag_secret_key_path
end

#environmentObject

Returns the value of attribute environment.



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

def environment
  @environment
end

#file_backup_pathObject

Returns the value of attribute file_backup_path.



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

def file_backup_path
  @file_backup_path
end

#file_cache_pathObject

Returns the value of attribute file_cache_path.



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

def file_cache_path
  @file_cache_path
end

#validation_client_nameObject

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



23
24
25
# File 'lib/vagrant/provisioners/chef_client.rb', line 23

def validation_client_name
  @validation_client_name
end

#validation_key_pathObject

Returns the value of attribute validation_key_path.



12
13
14
# File 'lib/vagrant/provisioners/chef_client.rb', line 12

def validation_key_path
  @validation_key_path
end

Instance Method Details

#validate(env, errors) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/vagrant/provisioners/chef_client.rb', line 29

def validate(env, errors)
  super

  errors.add(I18n.t("vagrant.config.chef.server_url_empty")) if !chef_server_url || chef_server_url.strip == ""
  errors.add(I18n.t("vagrant.config.chef.validation_key_path")) if !validation_key_path
  errors.add(I18n.t("vagrant.config.chef.run_list_empty")) if @run_list && @run_list.empty?
end