Class: Tinychef::BootScript
- Inherits:
-
Object
- Object
- Tinychef::BootScript
- Defined in:
- lib/tinychef/boot_script.rb
Constant Summary collapse
- OPTIONS_ERROR =
<<-EOH Required arguments: DEST: ssh username@host string to use to connect to host. SCRIPT: optional path to the boot script (boot.sh by default). You must craft your Chef Solo boot script by yourself, something like this: https://gist.github.com/3153784 EOH
Instance Attribute Summary collapse
-
#dest ⇒ Object
readonly
Returns the value of attribute dest.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
Instance Method Summary collapse
-
#initialize(dest, script) ⇒ BootScript
constructor
A new instance of BootScript.
- #run ⇒ Object
Constructor Details
#initialize(dest, script) ⇒ BootScript
Returns a new instance of BootScript.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/tinychef/boot_script.rb', line 20 def initialize(dest, script) script ||= 'boot.sh' begin @dest = Tinychef::Destination.new(dest) @script = Pathname.new(script) rescue => e raise OptionsError.new BootScript::OPTIONS_ERROR end file_check end |
Instance Attribute Details
#dest ⇒ Object (readonly)
Returns the value of attribute dest.
18 19 20 |
# File 'lib/tinychef/boot_script.rb', line 18 def dest @dest end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
18 19 20 |
# File 'lib/tinychef/boot_script.rb', line 18 def script @script end |
Instance Method Details
#run ⇒ Object
33 34 35 36 |
# File 'lib/tinychef/boot_script.rb', line 33 def run push_to_remote execute_remote end |