Class: ImageBuilder::Provisioners::Shell
- Defined in:
- lib/image_builder/provisioners/shell.rb
Overview
Generic class doc comment
Constant Summary
Constants included from ImageBuilder
Instance Attribute Summary collapse
-
#binary ⇒ Object
Optional.
-
#environment_vars ⇒ Object
Returns the value of attribute environment_vars.
-
#execute_command ⇒ Object
Returns the value of attribute execute_command.
-
#inline ⇒ Object
Only one of these is allowed/required.
-
#inline_shebang ⇒ Object
Returns the value of attribute inline_shebang.
-
#remote_path ⇒ Object
Returns the value of attribute remote_path.
-
#script ⇒ Object
Returns the value of attribute script.
-
#scripts ⇒ Object
Returns the value of attribute scripts.
-
#start_retry_timeout ⇒ Object
Returns the value of attribute start_retry_timeout.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize ⇒ Shell
constructor
A new instance of Shell.
- #packer_hash ⇒ Object
Constructor Details
#initialize ⇒ Shell
Returns a new instance of Shell.
22 23 24 |
# File 'lib/image_builder/provisioners/shell.rb', line 22 def initialize @type = 'shell' end |
Instance Attribute Details
#binary ⇒ Object
Optional
13 14 15 |
# File 'lib/image_builder/provisioners/shell.rb', line 13 def binary @binary end |
#environment_vars ⇒ Object
Returns the value of attribute environment_vars.
14 15 16 |
# File 'lib/image_builder/provisioners/shell.rb', line 14 def environment_vars @environment_vars end |
#execute_command ⇒ Object
Returns the value of attribute execute_command.
15 16 17 |
# File 'lib/image_builder/provisioners/shell.rb', line 15 def execute_command @execute_command end |
#inline ⇒ Object
Only one of these is allowed/required
8 9 10 |
# File 'lib/image_builder/provisioners/shell.rb', line 8 def inline @inline end |
#inline_shebang ⇒ Object
Returns the value of attribute inline_shebang.
16 17 18 |
# File 'lib/image_builder/provisioners/shell.rb', line 16 def inline_shebang @inline_shebang end |
#remote_path ⇒ Object
Returns the value of attribute remote_path.
17 18 19 |
# File 'lib/image_builder/provisioners/shell.rb', line 17 def remote_path @remote_path end |
#script ⇒ Object
Returns the value of attribute script.
9 10 11 |
# File 'lib/image_builder/provisioners/shell.rb', line 9 def script @script end |
#scripts ⇒ Object
Returns the value of attribute scripts.
10 11 12 |
# File 'lib/image_builder/provisioners/shell.rb', line 10 def scripts @scripts end |
#start_retry_timeout ⇒ Object
Returns the value of attribute start_retry_timeout.
18 19 20 |
# File 'lib/image_builder/provisioners/shell.rb', line 18 def start_retry_timeout @start_retry_timeout end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
20 21 22 |
# File 'lib/image_builder/provisioners/shell.rb', line 20 def type @type end |
Instance Method Details
#packer_hash ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/image_builder/provisioners/shell.rb', line 26 def packer_hash hash = { type: @type } # Let packer enforce the validation requirements # for these attributes, don't make them required attr_to_hash(hash, :inline) attr_to_hash(hash, :script) attr_to_hash(hash, :scripts) # Optional attrs attr_to_hash(hash, :binary) attr_to_hash(hash, :environment_vars) attr_to_hash(hash, :execute_command) attr_to_hash(hash, :inline_shebang) attr_to_hash(hash, :remote_path) attr_to_hash(hash, :start_retry_timeout) hash end |