Class: Packer::Provisioner::WindowsShell

Inherits:
Packer::Provisioner show all
Defined in:
lib/packer/provisioners/windows_shell.rb

Constant Summary

Constants inherited from Packer::Provisioner

ANSIBLE, CHEF_CLIENT, 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

#initializeWindowsShell

Returns a new instance of WindowsShell.



8
9
10
11
12
# File 'lib/packer/provisioners/windows_shell.rb', line 8

def initialize
  super
  self.data['type'] = WINDOWS_SHELL
  self.add_required(['inline', 'script', 'scripts'])
end

Instance Method Details

#binary(bool) ⇒ Object



26
27
28
# File 'lib/packer/provisioners/windows_shell.rb', line 26

def binary(bool)
  self.__add_boolean('binary', bool, [])
end

#environment_vars(envpairs) ⇒ Object



30
31
32
# File 'lib/packer/provisioners/windows_shell.rb', line 30

def environment_vars(envpairs)
  self.__add_array_of_strings('environment_vars', envpairs)
end

#execute_command(command) ⇒ Object



34
35
36
# File 'lib/packer/provisioners/windows_shell.rb', line 34

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

#inline(commands) ⇒ Object



14
15
16
# File 'lib/packer/provisioners/windows_shell.rb', line 14

def inline(commands)
  self.__add_array_of_strings('inline', commands, %w[script scripts])
end

#remote_path(command) ⇒ Object



38
39
40
# File 'lib/packer/provisioners/windows_shell.rb', line 38

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

#script(filename) ⇒ Object



18
19
20
# File 'lib/packer/provisioners/windows_shell.rb', line 18

def script(filename)
  self.__add_string('script', filename, %w[inline scripts])
end

#scripts(filenames) ⇒ Object



22
23
24
# File 'lib/packer/provisioners/windows_shell.rb', line 22

def scripts(filenames)
  self.__add_array_of_strings('scripts', filenames, %w[inline script])
end

#start_retry_timeout(time) ⇒ Object



42
43
44
# File 'lib/packer/provisioners/windows_shell.rb', line 42

def start_retry_timeout(time)
  self.__add_string('start_retry_timeout', time)
end