Class: Packer::Provisioner::Chef::Client

Inherits:
Packer::Provisioner::Chef show all
Defined in:
lib/packer/provisioners/chef/client.rb

Constant Summary

Constants inherited from Packer::Provisioner

ANSIBLE, Packer::Provisioner::CHEF_CLIENT, Packer::Provisioner::CHEF_SOLO, FILE, POWERSHELL, PUPPET_MASTERLESS, PUPPET_SERVER, SALT, SHELL, VALID_PROVISIONER_TYPES, WINDOWS_RESTART, WINDOWS_SHELL

Instance Attribute Summary

Attributes inherited from DataObject

#data, #key_dependencies, #required

Instance Method Summary collapse

Methods inherited from Packer::Provisioner

#except, get_provisioner, #only, #override, #pause_before, types

Methods inherited from DataObject

#__add_array_of_array_of_strings, #__add_array_of_hashes, #__add_array_of_ints, #__add_array_of_strings, #__add_boolean, #__add_hash, #__add_integer, #__add_json, #__add_string, #__exclusive_key_error, #add_key_dependencies, #add_required, #deep_copy, #validate, #validate_key_dependencies, #validate_required

Constructor Details

#initializeClient

Returns a new instance of Client.



9
10
11
12
13
# File 'lib/packer/provisioners/chef/client.rb', line 9

def initialize
  super
  self.data['type'] = CHEF_CLIENT
  self.add_required(['server_url'])
end

Instance Method Details

#chef_environment(env) ⇒ Object



19
20
21
# File 'lib/packer/provisioners/chef/client.rb', line 19

def chef_environment(env)
  self.__add_string('chef_environment', env)
end

#config_template(filename) ⇒ Object



23
24
25
# File 'lib/packer/provisioners/chef/client.rb', line 23

def config_template(filename)
  self.__add_string('config_template', filename)
end

#execute_command(command) ⇒ Object



27
28
29
# File 'lib/packer/provisioners/chef/client.rb', line 27

def execute_command(command)
  self.__add_string('execute_command', command)
end

#install_command(command) ⇒ Object



31
32
33
# File 'lib/packer/provisioners/chef/client.rb', line 31

def install_command(command)
  self.__add_string('install_command', command)
end

#node_name(name) ⇒ Object

TODO How to support json?



37
38
39
# File 'lib/packer/provisioners/chef/client.rb', line 37

def node_name(name)
  self.__add_string('node_name', name)
end

#prevent_sudo(bool) ⇒ Object



41
42
43
# File 'lib/packer/provisioners/chef/client.rb', line 41

def prevent_sudo(bool)
  self.__add_boolean('prevent_sudo', bool)
end

#run_list(list) ⇒ Object



45
46
47
# File 'lib/packer/provisioners/chef/client.rb', line 45

def run_list(list)
  self.__add_array_of_strings('run_list', list)
end

#server_url(url) ⇒ Object



15
16
17
# File 'lib/packer/provisioners/chef/client.rb', line 15

def server_url(url)
  self.__add_string('server_url', url)
end

#skip_clean_client(bool) ⇒ Object



49
50
51
# File 'lib/packer/provisioners/chef/client.rb', line 49

def skip_clean_client(bool)
  self.__add_bool('skip_clean_client', bool)
end

#skip_clean_node(bool) ⇒ Object



53
54
55
# File 'lib/packer/provisioners/chef/client.rb', line 53

def skip_clean_node(bool)
  self.__add_bool('skip_clean_node', bool)
end

#skip_install(bool) ⇒ Object



57
58
59
# File 'lib/packer/provisioners/chef/client.rb', line 57

def skip_install(bool)
  self.__add_bool('skip_install', bool)
end

#staging_directory(dirname) ⇒ Object



61
62
63
# File 'lib/packer/provisioners/chef/client.rb', line 61

def staging_directory(dirname)
  self.__add_string('staging_directory', dirname)
end

#validation_client_name(name) ⇒ Object



65
66
67
# File 'lib/packer/provisioners/chef/client.rb', line 65

def validation_client_name(name)
  self.__add_string('validation_client_name', name)
end

#validation_key_path(path) ⇒ Object



69
70
71
# File 'lib/packer/provisioners/chef/client.rb', line 69

def validation_key_path(path)
  self.__add_string('validation_key_path', path)
end